summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVitaly Cheptsov <4348897+vit9696@users.noreply.github.com>2021-08-31 16:05:01 +0300
committerGitHub <noreply@github.com>2021-08-31 06:05:01 -0700
commitb1dbdc5e21346de0fec7fbb814dedbe1585bcfec (patch)
treef39a2416a742dcbf4193b96e7f8aa10c38d2618e /utils
parent302855a6f30bdec33614a145f1dbe031316f351a (diff)
downloadpycparser-b1dbdc5e21346de0fec7fbb814dedbe1585bcfec.tar.gz
Introduce partial C11 support (#429)
* Introduce partial C11 support Implemented _Noreturn, _Static_assert, _Thread_local. Also fixed tests with preprocessor on macOS. * Add more tests Co-authored-by: vit9696 <vit9696@users.noreply.github.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/fake_libc_include/_fake_defines.h14
-rw-r--r--utils/fake_libc_include/stdnoreturn.h2
-rw-r--r--utils/fake_libc_include/threads.h2
3 files changed, 16 insertions, 2 deletions
diff --git a/utils/fake_libc_include/_fake_defines.h b/utils/fake_libc_include/_fake_defines.h
index 24cc0ab..f2e8dd4 100644
--- a/utils/fake_libc_include/_fake_defines.h
+++ b/utils/fake_libc_include/_fake_defines.h
@@ -206,8 +206,6 @@
#define va_arg(_ap, _type) __builtin_va_arg((_ap))
#define va_end(_list)
-#endif
-
/* Vectors */
#define __m128 int
#define __m128_u int
@@ -227,3 +225,15 @@
#define __m512d_u int
#define __m512i int
#define __m512i_u int
+
+/* C11 stdnoreturn.h defines */
+#define __noreturn_is_defined 1
+#define noreturn _Noreturn
+
+/* C11 threads.h defines */
+#define thread_local _Thread_local
+
+/* C11 assert.h defines */
+#define static_assert _Static_assert
+
+#endif
diff --git a/utils/fake_libc_include/stdnoreturn.h b/utils/fake_libc_include/stdnoreturn.h
new file mode 100644
index 0000000..f952c1d
--- /dev/null
+++ b/utils/fake_libc_include/stdnoreturn.h
@@ -0,0 +1,2 @@
+#include "_fake_defines.h"
+#include "_fake_typedefs.h"
diff --git a/utils/fake_libc_include/threads.h b/utils/fake_libc_include/threads.h
new file mode 100644
index 0000000..f952c1d
--- /dev/null
+++ b/utils/fake_libc_include/threads.h
@@ -0,0 +1,2 @@
+#include "_fake_defines.h"
+#include "_fake_typedefs.h"