2 * Copyright Andrey Semashev 2017.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
8 * \file winapi_info.cpp
9 * \author Andrey Semashev
12 * \brief This file contains a test that displays information about Windows SDK.
15 #define BOOST_USE_WINDOWS_H
17 // NOTE: Use Boost.Predef, the most fine graned header to detect Windows. This header should not include anything
18 // system- or STL-specific so that the check for Boost.WinAPI header self-sufficiency is not subverted.
19 // Boost.Config does not satisfy this requirement.
20 #include <boost/predef/os/windows.h>
25 #include <boost/winapi/config.hpp>
28 #include <boost/config.hpp>
30 void print_macro(const char* name
, const char* value
)
32 // If a macro is not defined, value will contain the macro name after the starting dot
33 if (strcmp(name
, value
+ 1) == 0)
35 printf("%s is not defined\n", name
);
39 printf("%s: \"%s\"\n", name
, value
+ 1);
43 #define PRINT_MACRO(x) print_macro(#x, BOOST_STRINGIZE(.x))
45 void print_winsdk_macros()
47 printf("Windows SDK macros:\n===================\n\n");
49 PRINT_MACRO(_WIN32_WINNT
);
51 PRINT_MACRO(NTDDI_VERSION
);
52 PRINT_MACRO(_WIN32_IE
);
53 PRINT_MACRO(BOOST_USE_WINAPI_VERSION
);
54 PRINT_MACRO(BOOST_NO_ANSI_APIS
);
55 PRINT_MACRO(BOOST_WINAPI_IS_MINGW
);
56 PRINT_MACRO(BOOST_WINAPI_IS_MINGW_W64
);
57 PRINT_MACRO(__W32API_VERSION
);
58 PRINT_MACRO(__W32API_MAJOR_VERSION
);
59 PRINT_MACRO(__W32API_MINOR_VERSION
);
60 PRINT_MACRO(__W32API_PATCHLEVEL
);
61 PRINT_MACRO(WINAPI_FAMILY
);
62 PRINT_MACRO(UNDER_CE
);
63 PRINT_MACRO(_WIN32_WCE_EMULATION
);
66 PRINT_MACRO(__WIN32__
);
68 PRINT_MACRO(__CYGWIN__
);
70 PRINT_MACRO(_MANAGED
);
72 PRINT_MACRO(_UNICODE
);
74 PRINT_MACRO(NO_STRICT
);
75 PRINT_MACRO(WIN32_LEAN_AND_MEAN
);
79 PRINT_MACRO(WINBASEAPI
);
80 PRINT_MACRO(NTSYSAPI
);
83 PRINT_MACRO(CALLBACK
);
84 PRINT_MACRO(APIENTRY
);
89 #else // BOOST_OS_WINDOWS
91 void print_winsdk_macros()
95 #endif // BOOST_OS_WINDOWS
97 int main(int, char*[])
99 print_winsdk_macros();