Chris@16: // boost/system/api_config.hpp -------------------------------------------------------// Chris@16: Chris@16: // Copyright Beman Dawes 2003, 2006, 2010 Chris@16: Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See http://www.boost.org/LICENSE_1_0.txt Chris@16: Chris@16: // See http://www.boost.org/libs/system for documentation. Chris@16: Chris@16: //--------------------------------------------------------------------------------------// Chris@16: Chris@16: // Boost.System calls operating system API functions to implement system error category Chris@16: // functions. Usually there is no question as to which API is to be used. Chris@16: // Chris@16: // In the case of MinGW or Cygwin/MinGW, however, both POSIX and Windows API's are Chris@16: // available. Chaos ensues if other code thinks one is in use when Boost.System was Chris@16: // actually built with the other. This header centralizes the API choice and prevents Chris@16: // user definition of API macros, thus elminating the possibility of mismatches and the Chris@16: // need to test configurations with little or no practical value. Chris@16: // Chris@16: Chris@16: //--------------------------------------------------------------------------------------// Chris@16: Chris@16: #ifndef BOOST_SYSTEM_API_CONFIG_HPP Chris@16: #define BOOST_SYSTEM_API_CONFIG_HPP Chris@16: Chris@16: # if defined(BOOST_POSIX_API) || defined(BOOST_WINDOWS_API) Chris@16: # error user defined BOOST_POSIX_API or BOOST_WINDOWS_API not supported Chris@16: # endif Chris@16: Chris@16: // BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use Chris@16: // Cygwin/MinGW does not predefine _WIN32. Chris@16: // Standalone MinGW and all other known Windows compilers do predefine _WIN32 Chris@16: // Compilers that predefine _WIN32 or __MINGW32__ do so for Windows 64-bit builds too. Chris@16: Chris@16: # if defined(_WIN32) || defined(__CYGWIN__) // Windows default, including MinGW and Cygwin Chris@16: # define BOOST_WINDOWS_API Chris@16: # else Chris@16: # define BOOST_POSIX_API Chris@16: # endif Chris@16: Chris@16: #endif // BOOST_SYSTEM_API_CONFIG_HPP