After upgrading to the latest 2.0.32 tip, I experienced a strange crash on XP in a DLL built with Juce. Since it only crashed on XP, but worked fine on Windows 7 and above, it instantly smelled like something “threadish” or “IPCish” to me. The outcome of a lot of narrowing down and wild guessing was it had something to do with thread locals. Although I’m not familiar with the concept, looking at juce_TheadLocalValue.h was enlightening: Jules helpful comment pointed out that something is not working on XP and Win32 exclusively, and, without understanding what that actually is, I knew it needed to be eliminated
Now, the switch JUCE_NO_COMPILER_THREAD_LOCAL needed to be 1 to fix my crash. The cool conditional expression that is supposed to trigger in this case did not apply here.
The reason I post this is that I feel there should be a more obvious and reliable way to tell whether a DLL project is supposed to be compatible with XP or not, so this switch can be set appropriately. Usually, if we compile for Windows, we expect the product to run on XP and above, so probably all WIN32 DLL projects may need this turned on by default?
For now I hacked the source to get my code going. How would the conditional expression be rewritten to cover this case? Is there an alternative way to deal with this?