Reported ldap_pvt_thread.h problem as gcc bug #38161:
We can wait a bit to see what they say. A workaround is to replace
the #elif with #else / #if / #endif, but that's less readable.
...fixing. Don't know what gcc will do, and it looks like it will
addressed in the next C standard, but that's for later. In the mean
time another compiler turned up which does the same, so there may well
be more in any case.