• R/O
  • SSH

libctools: Commit

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


Commit MetaInfo

Revisióna1050481a449fcdfdbe68e36671914bce7fd7c2e (tree)
Tiempo2022-10-05 09:48:13
AutorSergey Gusarov <laborer2008@gmai...>
CommiterSergey Gusarov

Log Message

attributes: More compatibility with bcc

Cambiar Resumen

Diferencia incremental

diff -r bed72ac5f701 -r a1050481a449 include/ctools/predef/attributes.h
--- a/include/ctools/predef/attributes.h Wed Oct 05 03:47:31 2022 +0300
+++ b/include/ctools/predef/attributes.h Wed Oct 05 03:48:13 2022 +0300
@@ -96,10 +96,25 @@
9696 # define CT_GCC_UNUSED
9797
9898 # define CT_FORCEINLINE __inline
99-# define CT_ALIGNED(x) // TODO? alignof(x)
99+
100+# if defined (CT_LANG_C11)
101+# define CT_ALIGNED(x) _Alignas(x)
102+# elif defined (CT_LANG_CXX11)
103+# define CT_ALIGNED(x) alignas(x)
104+# elif defined (__cplusplus)
105+# define CT_ALIGNED(x) alignof(x)
106+# else
107+# define CT_ALIGNED(x)
108+# endif
100109
101110 # ifdef __clang__
102-# define CT_NORETURN
111+# if defined (CT_LANG_C11)
112+# define CT_NORETURN _Noreturn
113+# elif defined (CT_LANG_CXX11)
114+# define CT_NORETURN noreturn
115+# else
116+# define CT_NORETURN
117+# endif
103118 # else
104119 # define CT_NORETURN __declspec(noreturn)
105120 # endif
diff -r bed72ac5f701 -r a1050481a449 include/ctools/predef/external_headers.h
--- a/include/ctools/predef/external_headers.h Wed Oct 05 03:47:31 2022 +0300
+++ b/include/ctools/predef/external_headers.h Wed Oct 05 03:48:13 2022 +0300
@@ -117,6 +117,12 @@
117117 # define CT_END_EXTERNAL_HEADERS
118118 # endif
119119
120+#elif defined (CT_COMPL_BCC)
121+
122+// TODO: clang-based variant is also possible here
123+# define CT_BEGIN_EXTERNAL_HEADERS
124+# define CT_END_EXTERNAL_HEADERS
125+
120126 #elif defined (CT_COMPL_CLANG)
121127
122128 # ifdef CT_CLANG_3_5_1_ABOVE_WARNING_LIST
Show on old repository browser