
What's the recommended way to deal with windows.h in Boost? I see a lot of libraries doing stuff like #if defined( BOOST_USE_WINDOWS_H ) # include <windows.h> #endif namespace boost { namespace detail { #if !defined( BOOST_USE_WINDOWS_H ) extern "C" void __stdcall Sleep( unsigned long ms ); #endif So should libraries just declare all symbols themselves? But here the declaration is wrong, it misses __declspec(dllimport) for example when the runtime CRT is used, unnecessarily requiring import libraries. WINBASEAPI/WINADVAPI macros could be used to fix that. There is also the file <boost/detail/win/basic_types.hpp> that contains a few of the types, but it doesn't seem to be used that much except by other files in detail/win, and then again they don't re-use WINAPI and other macros. It also seems to be lacking the WINBASEAPI/WINADVAPI macros. Also, why couldn't headers simply include <windef.h> then <winbase.h>? Does that cause problems too?