I just discovered that when Language Extensions are disabled in MSVC, you get this error if you try to include boost/thread/thread.hpp
:
fatal error C1189: #error : "Threading support unavaliable: it has been explicitly disabled with
BOOST_DISABLE_THREADS
"
It seems that when Boost detects that language extensions are disabled (_MSC_EXTENSIONS
isn't defined), they define BOOST_DISABLE_WIN32
, to indicate that it is not safe to include windows.h
(which won't compile without extensions enabled).
And as a consequence of that #define, BOOST_DISABLE_THREADS
is defined, even though Boost.Thread isn't a header-only library, and windows.h
is only included in the .cpp files. The headers should in principle be safe to use without language extensions. All the actual win32 calls are isolated in the compiled library (the .dll or .lib)
I can see here that they're aware of the problem, but as it's remained untouched for the last two years, it's probably naive to hope for a quick fix.
It seems like it should be a fairly simple case of modifying some of the #ifdef
's and #defines
in the various Boost configuration files, but there are a lot of them, and they define and use a lot of macros whose purpose isn't clear to me.
Do anyone know of a simple hack or workaround to allow inclusion of the Boost.Thread headers when language extensions are disabled?