1 | /* |
2 | Copyright Rene Rivera 2011-2015 |
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 | #ifndef BOOST_PREDEF_LANGUAGE_STDCPP_H |
9 | #define BOOST_PREDEF_LANGUAGE_STDCPP_H |
10 | |
11 | #include <boost/predef/version_number.h> |
12 | #include <boost/predef/make.h> |
13 | |
14 | /* tag::reference[] |
15 | = `BOOST_LANG_STDCPP` |
16 | |
17 | http://en.wikipedia.org/wiki/C%2B%2B[Standard {CPP}] language. |
18 | If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. |
19 | Because of the way the {CPP} standardization process works the |
20 | defined version year will not be the commonly known year of the standard. |
21 | Specifically the defined versions are: |
22 | |
23 | .Detected Version Number vs. {CPP} Standard Year |
24 | [options="header"] |
25 | |=== |
26 | | Detected Version Number | Standard Year | {CPP} Standard |
27 | | 27.11.1 | 1998 | ISO/IEC 14882:1998 |
28 | | 41.3.1 | 2011 | ISO/IEC 14882:2011 |
29 | | 44.2.1 | 2014 | ISO/IEC 14882:2014 |
30 | | 47.3.1 | 2017 | ISO/IEC 14882:2017 |
31 | |=== |
32 | |
33 | [options="header"] |
34 | |=== |
35 | | {predef_symbol} | {predef_version} |
36 | |
37 | | `+__cplusplus+` | {predef_detection} |
38 | |
39 | | `+__cplusplus+` | YYYY.MM.1 |
40 | |=== |
41 | */ // end::reference[] |
42 | |
43 | #define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_NOT_AVAILABLE |
44 | |
45 | #if defined(__cplusplus) |
46 | # undef BOOST_LANG_STDCPP |
47 | # if (__cplusplus > 100) |
48 | # define BOOST_LANG_STDCPP BOOST_PREDEF_MAKE_YYYYMM(__cplusplus) |
49 | # else |
50 | # define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_AVAILABLE |
51 | # endif |
52 | #endif |
53 | |
54 | #if BOOST_LANG_STDCPP |
55 | # define BOOST_LANG_STDCPP_AVAILABLE |
56 | #endif |
57 | |
58 | #define BOOST_LANG_STDCPP_NAME "Standard C++" |
59 | |
60 | /* tag::reference[] |
61 | = `BOOST_LANG_STDCPPCLI` |
62 | |
63 | http://en.wikipedia.org/wiki/C%2B%2B/CLI[Standard {CPP}/CLI] language. |
64 | If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. |
65 | |
66 | [options="header"] |
67 | |=== |
68 | | {predef_symbol} | {predef_version} |
69 | |
70 | | `+__cplusplus_cli+` | {predef_detection} |
71 | |
72 | | `+__cplusplus_cli+` | YYYY.MM.1 |
73 | |=== |
74 | */ // end::reference[] |
75 | |
76 | #define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_NOT_AVAILABLE |
77 | |
78 | #if defined(__cplusplus_cli) |
79 | # undef BOOST_LANG_STDCPPCLI |
80 | # if (__cplusplus_cli > 100) |
81 | # define BOOST_LANG_STDCPPCLI BOOST_PREDEF_MAKE_YYYYMM(__cplusplus_cli) |
82 | # else |
83 | # define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_AVAILABLE |
84 | # endif |
85 | #endif |
86 | |
87 | #if BOOST_LANG_STDCPPCLI |
88 | # define BOOST_LANG_STDCPPCLI_AVAILABLE |
89 | #endif |
90 | |
91 | #define BOOST_LANG_STDCPPCLI_NAME "Standard C++/CLI" |
92 | |
93 | /* tag::reference[] |
94 | = `BOOST_LANG_STDECPP` |
95 | |
96 | http://en.wikipedia.org/wiki/Embedded_C%2B%2B[Standard Embedded {CPP}] language. |
97 | |
98 | [options="header"] |
99 | |=== |
100 | | {predef_symbol} | {predef_version} |
101 | |
102 | | `+__embedded_cplusplus+` | {predef_detection} |
103 | |=== |
104 | */ // end::reference[] |
105 | |
106 | #define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_NOT_AVAILABLE |
107 | |
108 | #if defined(__embedded_cplusplus) |
109 | # undef BOOST_LANG_STDECPP |
110 | # define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_AVAILABLE |
111 | #endif |
112 | |
113 | #if BOOST_LANG_STDECPP |
114 | # define BOOST_LANG_STDECPP_AVAILABLE |
115 | #endif |
116 | |
117 | #define BOOST_LANG_STDECPP_NAME "Standard Embedded C++" |
118 | |
119 | #endif |
120 | |
121 | #include <boost/predef/detail/test.h> |
122 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME) |
123 | |
124 | #include <boost/predef/detail/test.h> |
125 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME) |
126 | |
127 | #include <boost/predef/detail/test.h> |
128 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDECPP,BOOST_LANG_STDECPP_NAME) |
129 | |