• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisión744f48c49ba401fdf08d0529ba864f1acf148cf0 (tree)
Tiempo2022-02-10 07:23:23
AutorSergey Gusarov <laborer2008@gmai...>
CommiterSergey Gusarov

Log Message

Added detect of CXX20 and CXX23 standards

Cambiar Resumen

Diferencia incremental

diff -r 0b3a944cef09 -r 744f48c49ba4 .hgsubstate
--- a/.hgsubstate Thu Jan 09 19:18:09 2020 +0300
+++ b/.hgsubstate Thu Feb 10 01:23:23 2022 +0300
@@ -1,4 +1,4 @@
11 f7e63ef13448899bf99322d3bef4696b8597e170 cmake/cmake_tools
22 5013d507802becd2c434d4dbdafad45c3da5ef23 include/ctools/std/msinttypes
3-06beda7c7cf3133dc256db280a0feb22b129f49f pyrepo
3+463a0e69fbc86ba03df16f8957d08fec6f40bbbb pyrepo
44 c3d7662a1e692aa0934fa61a2a67229f3b73a5a2 tests/unity
diff -r 0b3a944cef09 -r 744f48c49ba4 include/ctools/predef/language.h
--- a/include/ctools/predef/language.h Thu Jan 09 19:18:09 2020 +0300
+++ b/include/ctools/predef/language.h Thu Feb 10 01:23:23 2022 +0300
@@ -76,11 +76,29 @@
7676 # error CT_LANG_CXX17 must be undefined
7777 #endif
7878
79-#if defined (__cplusplus) && (__cplusplus > 201402L)
79+#if defined (__cplusplus) && (__cplusplus >= 201703L)
8080 # define CT_LANG_CXX17
8181 #endif
8282
8383
84+#ifdef CT_LANG_CXX20
85+# error CT_LANG_CXX20 must be undefined
86+#endif
87+
88+#if defined (__cplusplus) && (__cplusplus >= 202002L)
89+# define CT_LANG_CXX20
90+#endif
91+
92+
93+#ifdef CT_LANG_CXX23
94+# error CT_LANG_CXX23 must be undefined
95+#endif
96+
97+#if defined (__cplusplus) && (__cplusplus > 202002L)
98+# define CT_LANG_CXX23
99+#endif
100+
101+
84102 #ifdef CT_LANG_OBJC
85103 # error CT_LANG_OBJC must be undefined
86104 #endif
diff -r 0b3a944cef09 -r 744f48c49ba4 tests/src/predef/test_language.c
--- a/tests/src/predef/test_language.c Thu Jan 09 19:18:09 2020 +0300
+++ b/tests/src/predef/test_language.c Thu Feb 10 01:23:23 2022 +0300
@@ -41,11 +41,15 @@
4141 int a = 5;
4242 #elif defined (CT_LANG_CXX17)
4343 int a = 6;
44+#elif defined (CT_LANG_CXX20)
45+ int a = 7;
46+#elif defined (CT_LANG_CXX23)
47+ int a = 8;
4448 #elif defined (CT_LANG_OBJC)
45- int a = 7;
49+ int a = 9;
4650 #elif defined (CT_COMPL_MSVC) || defined (CT_COMPL_BCC)
4751 // These compilers don't support some of above mentioned standards
48- int a = 8;
52+ int a = 10;
4953 #endif
5054
5155 CT_UNUSED(a);
Show on old repository browser