File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,22 +30,6 @@ SOFTWARE.
3030
3131// NOLINTBEGIN
3232
33- // ====================================================|
34- // C++ standard |
35- // |
36-
37- #if __cplusplus > 201703L
38- # define CFG_CPP 20
39- #elif __cplusplus > 201402L
40- # define CFG_CPP 17
41- #elif __cplusplus > 201103L
42- # define CFG_CPP 14
43- #elif __cplusplus > 199711L
44- # define CFG_CPP 11
45- #else
46- # define CFG_CPP 3
47- #endif
48-
4933// ======================================|
5034// OS definitions |
5135// |
@@ -165,6 +149,31 @@ SOFTWARE.
165149# define CFG_COMPILER CFG_COMPILER_UNKNOWN
166150#endif
167151
152+ // ====================================================|
153+ // C++ standard |
154+ // |
155+
156+ // In MSVC the __cplusplus macro is not set according to the actual standard used,
157+ // this is done as a workaround for legacy software which relied on __cplusplus being
158+ // certain values. To get the actual C++ standard in MSVC the _MSVC_LANG macro should be used.
159+ #if CFG_COMPILER == CFG_COMPILER_MSVC
160+ # define UTKI_CPP_STANDARD _MSVC_LANG
161+ #else
162+ # define UTKI_CPP_STANDARD __cplusplus
163+ #endif
164+
165+ #if UTKI_CPP_STANDARD > 201703L
166+ # define CFG_CPP 20
167+ #elif UTKI_CPP_STANDARD > 201402L
168+ # define CFG_CPP 17
169+ #elif UTKI_CPP_STANDARD > 201103L
170+ # define CFG_CPP 14
171+ #elif UTKI_CPP_STANDARD > 199711L
172+ # define CFG_CPP 11
173+ #else
174+ # define CFG_CPP 3
175+ #endif
176+
168177// ====================================================|
169178// CPU architecture definitions |
170179// |
You can’t perform that action at this time.
0 commit comments