1 /*
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)
6 */
7 /*!
8 * \file winapi_info.cpp
9 * \author Andrey Semashev
10 * \date 25.06.2017
11 *
12 * \brief This file contains a test that displays information about Windows SDK.
13 */
14
15 #define BOOST_USE_WINDOWS_H
16
17 #include <windows.h>
18 #include <boost/winapi/config.hpp>
19 #include <stdio.h>
20 #include <string.h>
21 #include <boost/config.hpp>
22 #include <boost/predef/platform/windows_uwp.h>
23
print_macro(const char * name,const char * value)24 void print_macro(const char* name, const char* value)
25 {
26 // If a macro is not defined, value will contain the macro name after the starting dot
27 if (strcmp(name, value + 1) == 0)
28 {
29 printf("%s is not defined\n", name);
30 }
31 else
32 {
33 printf("%s: \"%s\"\n", name, value + 1);
34 }
35 }
36
37 #define PRINT_MACRO(x) print_macro(#x, BOOST_STRINGIZE(.x))
38
print_winsdk_macros()39 void print_winsdk_macros()
40 {
41 printf("Windows SDK macros:\n===================\n\n");
42
43 PRINT_MACRO(_WIN32_WINNT);
44 PRINT_MACRO(WINVER);
45 PRINT_MACRO(NTDDI_VERSION);
46 PRINT_MACRO(_WIN32_IE);
47 PRINT_MACRO(BOOST_USE_WINAPI_VERSION);
48 PRINT_MACRO(BOOST_NO_ANSI_APIS);
49 PRINT_MACRO(BOOST_WINAPI_IS_MINGW);
50 PRINT_MACRO(BOOST_WINAPI_IS_MINGW_W64);
51 PRINT_MACRO(BOOST_WINAPI_IS_CYGWIN);
52 PRINT_MACRO(BOOST_PLAT_WINDOWS_SDK_VERSION);
53 PRINT_MACRO(__W32API_VERSION);
54 PRINT_MACRO(__W32API_MAJOR_VERSION);
55 PRINT_MACRO(__W32API_MINOR_VERSION);
56 PRINT_MACRO(__W32API_PATCHLEVEL);
57 PRINT_MACRO(WINAPI_FAMILY);
58 PRINT_MACRO(UNDER_CE);
59 PRINT_MACRO(_WIN32_WCE_EMULATION);
60 PRINT_MACRO(WIN32);
61 PRINT_MACRO(_WIN32);
62 PRINT_MACRO(__WIN32__);
63 PRINT_MACRO(_WIN64);
64 PRINT_MACRO(__CYGWIN__);
65 PRINT_MACRO(_X86_);
66 PRINT_MACRO(_AMD64_);
67 PRINT_MACRO(_IA64_);
68 PRINT_MACRO(_ARM_);
69 PRINT_MACRO(_ARM64_);
70 PRINT_MACRO(_MAC);
71 PRINT_MACRO(_MANAGED);
72 PRINT_MACRO(UNICODE);
73 PRINT_MACRO(_UNICODE);
74 PRINT_MACRO(STRICT);
75 PRINT_MACRO(NO_STRICT);
76 PRINT_MACRO(WIN32_LEAN_AND_MEAN);
77
78 printf("\n");
79
80 PRINT_MACRO(WINBASEAPI);
81 PRINT_MACRO(NTSYSAPI);
82 PRINT_MACRO(WINAPI);
83 PRINT_MACRO(NTAPI);
84 PRINT_MACRO(CALLBACK);
85 PRINT_MACRO(APIENTRY);
86 PRINT_MACRO(BOOST_WINAPI_WINAPI_CC);
87 PRINT_MACRO(BOOST_WINAPI_NTAPI_CC);
88 PRINT_MACRO(BOOST_WINAPI_CALLBACK_CC);
89 PRINT_MACRO(VOID);
90 PRINT_MACRO(CONST);
91 }
92
main(int,char * [])93 int main(int, char*[])
94 {
95 print_winsdk_macros();
96 return 0;
97 }
98