| Home | Libraries | People | FAQ | More

## Configuration

Boost.WinAPI recognizes the following configuration macros:

Table 1.1. Configuration macros

Macro name | Effect
--- | ---
`BOOST_USE_WINAPI_VERSION` | If defined, designates the Windows API version to use. The version should be given as hexadecimal integer, same as the `_WIN32_WINNT` macro values. Some of the versions are given here. If the macro is not defined, the version is deduced from `_WIN32_WINNT` and `WINVER` macros, if they are defined, or the default version is chosen. The default version is currently Windows Vista/Server 2008 on compilers that support this version of SDK and Windows XP on others. The default may change in future releases.
`BOOST_USE_WINDOWS_H` | This macro is part of Boost.Config. If defined, Boost.WinAPI will include `<windows.h>` and any other headers from Windows SDK as needed. Otherwise Boost.WinAPI will provide its own declarations of the SDK components as needed without including SDK headers.
`BOOST_NO_ANSI_APIS` | This macro is defined by Boost.Config on platforms that do not support narrow-character versions of some APIs. Boost.WinAPI will not declare narrow-character APIs when this macro is defined.

User's code can include `<boost/detail/winapi/config.hpp>` to define a number of macros that can be useful. Including this header is recommended in any code that involves Windows API usage.

Table 1.2. Defined configuration macros

Macro name | Effect
--- | ---
`BOOST_USE_WINAPI_VERSION` | If not defined by user, this macro is defined by the header to the target Windows API version.
`BOOST_WINAPI_VERSION_NT4`, `BOOST_WINAPI_VERSION_WIN2K`, `BOOST_WINAPI_VERSION_WINXP`, `BOOST_WINAPI_VERSION_WS03`, `BOOST_WINAPI_VERSION_WIN6`, `BOOST_WINAPI_VERSION_VISTA`, `BOOST_WINAPI_VERSION_WS08`, `BOOST_WINAPI_VERSION_LONGHORN`, `BOOST_WINAPI_VERSION_WIN7`, `BOOST_WINAPI_VERSION_WIN8`, `BOOST_WINAPI_VERSION_WINBLUE`, `BOOST_WINAPI_VERSION_WINTHRESHOLD`, `BOOST_WINAPI_VERSION_WIN10` | These macros expand to the constants designating the particular Windows versions and can be used together with `BOOST_USE_WINAPI_VERSION` in preprocessor version checks.
`BOOST_WINAPI_IS_MINGW` | Defined if Windows SDK is provided by MinGW.
`BOOST_WINAPI_IS_MINGW_W64` | Defined if Windows SDK is provided by MinGW-w64. Note that is does not mean that the code is compiled for 64-bit Windows.