In GCC, a local static variable is thread safe (using the __cxa_guard_acquire special function) if -fno-threadsafe-statics provided with a compiler option.
Similarly, the MSVC 2015 version and version support the same function and can be disabled using /Zc:threadSafeInit- .
Is there any macro or other functions, such as __EXCEPTIONS or __GXX_RTTI , to check at compile time if such functions are included or not? I think checking __cplusplus or _MSC_VER will not help.
source share