I'm writing some library code, which can optionally make use of a certain C++11 feature (
thread_local objects). However, I've found a bug that occurs only with the POSIX threading model (the Win32 one works fine) in MinGW-w64's builds of
So, how can I detect, using the preprocessor, whether the current compiler is a
g++ with the POSIX threading model?
g++ -v yields
... Thread model: win32 or
... Thread model: posix depending on the difference, but I need a way to conditionally compile code (to work around the bug) that doesn't involve invoking an extra instance of