Hi.

This adds
#define __STDC_NO_ATOMICS__ 1
#define __STDC_NO_COMPLEX__ 1
#define __STDC_NO_THREADS__ 1
#define __STDC_NO_VLA__ 1
and
an iso646.h header.

I think it should included in tcc.

I'm using an all of C header (https://pastebin.com/bjwRJY9Q) and if this
is part of tcc, I won't have to special-case the compiler inside the header.

Best regards,
Petr Skocik
>From 44fc74d6ad6c7366db9c9ffce162450292d79fbd Mon Sep 17 00:00:00 2001
From: Petr Skocik <[email protected]>
Date: Mon, 17 Jul 2017 15:34:45 +0200
Subject: [PATCH] add missing standard macros and iso646.h

---
 include/iso646.h | 16 ++++++++++++++++
 libtcc.c         |  4 ++++
 2 files changed, 20 insertions(+)
 create mode 100644 include/iso646.h

diff --git a/include/iso646.h b/include/iso646.h
new file mode 100644
index 0000000..8c1898f
--- /dev/null
+++ b/include/iso646.h
@@ -0,0 +1,16 @@
+#ifndef _ISO646_H
+#define _ISO646_H
+
+#define and	&&
+#define and_eq	&=
+#define bitand	&
+#define bitor	|
+#define compl	~
+#define not	!
+#define not_eq	!=
+#define or	||
+#define or_eq	|=
+#define xor	^
+#define xor_eq	^=
+
+#endif
diff --git a/libtcc.c b/libtcc.c
index bf13724..cb6c60a 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -775,6 +775,10 @@ LIBTCCAPI TCCState *tcc_new(void)
     tcc_define_symbol(s, "__STDC__", NULL);
     tcc_define_symbol(s, "__STDC_VERSION__", "199901L");
     tcc_define_symbol(s, "__STDC_HOSTED__", NULL);
+    tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1");
+    tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1");
+    tcc_define_symbol(s, "__STDC_NO_THREADS__", "1");
+    tcc_define_symbol(s, "__STDC_NO_VLA__", "1");
 
     /* target defines */
 #if defined(TCC_TARGET_I386)
-- 
2.13.0

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to