]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/winapi/test/run/winapi_info.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / winapi / test / run / winapi_info.cpp
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 // 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>
21
22 #if BOOST_OS_WINDOWS
23
24 #include <windows.h>
25 #include <boost/winapi/config.hpp>
26 #include <stdio.h>
27 #include <string.h>
28 #include <boost/config.hpp>
29
30 void print_macro(const char* name, const char* value)
31 {
32 // If a macro is not defined, value will contain the macro name after the starting dot
33 if (strcmp(name, value + 1) == 0)
34 {
35 printf("%s is not defined\n", name);
36 }
37 else
38 {
39 printf("%s: \"%s\"\n", name, value + 1);
40 }
41 }
42
43 #define PRINT_MACRO(x) print_macro(#x, BOOST_STRINGIZE(.x))
44
45 void print_winsdk_macros()
46 {
47 printf("Windows SDK macros:\n===================\n\n");
48
49 PRINT_MACRO(_WIN32_WINNT);
50 PRINT_MACRO(WINVER);
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);
64 PRINT_MACRO(WIN32);
65 PRINT_MACRO(_WIN32);
66 PRINT_MACRO(__WIN32__);
67 PRINT_MACRO(_WIN64);
68 PRINT_MACRO(__CYGWIN__);
69 PRINT_MACRO(_MAC);
70 PRINT_MACRO(_MANAGED);
71 PRINT_MACRO(UNICODE);
72 PRINT_MACRO(_UNICODE);
73 PRINT_MACRO(STRICT);
74 PRINT_MACRO(NO_STRICT);
75 PRINT_MACRO(WIN32_LEAN_AND_MEAN);
76
77 printf("\n");
78
79 PRINT_MACRO(WINBASEAPI);
80 PRINT_MACRO(NTSYSAPI);
81 PRINT_MACRO(WINAPI);
82 PRINT_MACRO(NTAPI);
83 PRINT_MACRO(CALLBACK);
84 PRINT_MACRO(APIENTRY);
85 PRINT_MACRO(VOID);
86 PRINT_MACRO(CONST);
87 }
88
89 #else // BOOST_OS_WINDOWS
90
91 void print_winsdk_macros()
92 {
93 }
94
95 #endif // BOOST_OS_WINDOWS
96
97 int main(int, char*[])
98 {
99 print_winsdk_macros();
100 return 0;
101 }