1 | /* |
2 | Copyright Rene Rivera 2011-2013 |
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 | /*` |
15 | [heading `BOOST_LANG_STDCPP`] |
16 | |
17 | [@http://en.wikipedia.org/wiki/C%2B%2B Standard C++] 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 C++ 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 | [table Detected Version Number vs. C++ Standard Year |
24 | [[Detected Version Number] [Standard Year] [C++ Standard]] |
25 | [[27.11.1] [1998] [ISO/IEC 14882:1998]] |
26 | [[41.12.1] [2011] [ISO/IEC 14882:2011]] |
27 | ] |
28 | |
29 | [table |
30 | [[__predef_symbol__] [__predef_version__]] |
31 | |
32 | [[`__cplusplus`] [__predef_detection__]] |
33 | |
34 | [[`__cplusplus`] [YYYY.MM.1]] |
35 | ] |
36 | */ |
37 | |
38 | #define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_NOT_AVAILABLE |
39 | |
40 | #if defined(__cplusplus) |
41 | # undef BOOST_LANG_STDCPP |
42 | # if (__cplusplus > 100) |
43 | # define BOOST_LANG_STDCPP BOOST_PREDEF_MAKE_YYYYMM(__cplusplus) |
44 | # else |
45 | # define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_AVAILABLE |
46 | # endif |
47 | #endif |
48 | |
49 | #if BOOST_LANG_STDCPP |
50 | # define BOOST_LANG_STDCPP_AVAILABLE |
51 | #endif |
52 | |
53 | #define BOOST_LANG_STDCPP_NAME "Standard C++" |
54 | |
55 | #include <boost/predef/detail/test.h> |
56 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME) |
57 | |
58 | |
59 | /*` |
60 | [heading `BOOST_LANG_STDCPPCLI`] |
61 | |
62 | [@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language. |
63 | If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. |
64 | |
65 | [table |
66 | [[__predef_symbol__] [__predef_version__]] |
67 | |
68 | [[`__cplusplus_cli`] [__predef_detection__]] |
69 | |
70 | [[`__cplusplus_cli`] [YYYY.MM.1]] |
71 | ] |
72 | */ |
73 | |
74 | #define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_NOT_AVAILABLE |
75 | |
76 | #if defined(__cplusplus_cli) |
77 | # undef BOOST_LANG_STDCPPCLI |
78 | # if (__cplusplus_cli > 100) |
79 | # define BOOST_LANG_STDCPPCLI BOOST_PREDEF_MAKE_YYYYMM(__cplusplus_cli) |
80 | # else |
81 | # define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_AVAILABLE |
82 | # endif |
83 | #endif |
84 | |
85 | #if BOOST_LANG_STDCPPCLI |
86 | # define BOOST_LANG_STDCPPCLI_AVAILABLE |
87 | #endif |
88 | |
89 | #define BOOST_LANG_STDCPPCLI_NAME "Standard C++/CLI" |
90 | |
91 | #include <boost/predef/detail/test.h> |
92 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME) |
93 | |
94 | |
95 | /*` |
96 | [heading `BOOST_LANG_STDECPP`] |
97 | |
98 | [@http://en.wikipedia.org/wiki/Embedded_C%2B%2B Standard Embedded C++] language. |
99 | |
100 | [table |
101 | [[__predef_symbol__] [__predef_version__]] |
102 | |
103 | [[`__embedded_cplusplus`] [__predef_detection__]] |
104 | ] |
105 | */ |
106 | |
107 | #define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_NOT_AVAILABLE |
108 | |
109 | #if defined(__embedded_cplusplus) |
110 | # undef BOOST_LANG_STDECPP |
111 | # define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_AVAILABLE |
112 | #endif |
113 | |
114 | #if BOOST_LANG_STDECPP |
115 | # define BOOST_LANG_STDECPP_AVAILABLE |
116 | #endif |
117 | |
118 | #define BOOST_LANG_STDECPP_NAME "Standard Embedded C++" |
119 | |
120 | #include <boost/predef/detail/test.h> |
121 | BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDECPP,BOOST_LANG_STDECPP_NAME) |
122 | |
123 | |
124 | #endif |
125 | |