]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/preprocessor/test/config_info.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / preprocessor / test / config_info.cpp
1 #include <iostream>
2 #include <iomanip>
3 #include <string.h>
4 #include <boost/preprocessor/stringize.hpp>
5
6 static unsigned int indent = 4;
7 static unsigned int width = 40;
8
9 using std::cout;
10 using std::istream;
11
12 void print_separator()
13 {
14 std::cout <<
15 "\n\n*********************************************************************\n\n";
16 }
17
18 void print_macro(const char* name, const char* value)
19 {
20 // if name == value+1 then then macro is not defined,
21 // in which case we don't print anything:
22 if(0 != strcmp(name, value+1))
23 {
24 for(unsigned i = 0; i < indent; ++i) std::cout.put(' ');
25 std::cout << std::setw(width);
26 cout.setf(istream::left, istream::adjustfield);
27 std::cout << name;
28 if(value[1])
29 {
30 // macro has a value:
31 std::cout << value << "\n";
32 }
33 else
34 {
35 // macro is defined but has no value:
36 std::cout << " [no value]\n";
37 }
38 }
39 }
40
41 #define PRINT_MACRO(X) print_macro(#X, BOOST_PP_STRINGIZE(=X))
42
43 void print_macros()
44 {
45
46 print_separator();
47
48 PRINT_MACRO(__GCCXML__);
49 PRINT_MACRO(__WAVE__);
50 PRINT_MACRO(__MWERKS__);
51 PRINT_MACRO(__EDG__);
52 PRINT_MACRO(_MSC_VER);
53 PRINT_MACRO(__clang__);
54 PRINT_MACRO(__DMC__);
55 PRINT_MACRO(__BORLANDC__);
56 PRINT_MACRO(__IBMC__);
57 PRINT_MACRO(__IBMCPP__);
58 PRINT_MACRO(__SUNPRO_CC);
59 PRINT_MACRO(__CUDACC__);
60 PRINT_MACRO(__PATHSCALE__);
61 PRINT_MACRO(__CODEGEARC__);
62 PRINT_MACRO(__HP_aCC);
63 PRINT_MACRO(__SC__);
64 PRINT_MACRO(__MRC__);
65 PRINT_MACRO(__PGI);
66 PRINT_MACRO(__INTEL_COMPILER);
67 PRINT_MACRO(__GNUC__);
68 PRINT_MACRO(__GXX_EXPERIMENTAL_CXX0X__);
69
70 print_separator();
71
72 PRINT_MACRO(__cplusplus);
73 PRINT_MACRO(__STDC_VERSION__);
74 PRINT_MACRO(__EDG_VERSION__);
75 PRINT_MACRO(__INTELLISENSE__);
76 PRINT_MACRO(__WAVE_HAS_VARIADICS__);
77
78 print_separator();
79
80 PRINT_MACRO(BOOST_PP_CONFIG_ERRORS);
81 PRINT_MACRO(BOOST_PP_CONFIG_EXTENDED_LINE_INFO);
82 PRINT_MACRO(BOOST_PP_CONFIG_FLAGS());
83 PRINT_MACRO(BOOST_PP_VARIADICS);
84 PRINT_MACRO(BOOST_PP_VARIADICS_MSVC);
85 }
86
87 int main()
88 {
89
90 print_macros();
91
92 return 0;
93 }