[PATCH 6/7] separate definition of __STDC_NO_ATOMICS__ and friends from C11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The definition of __STDC_NO_ATOMICS__ and friends will also
be needed for C17.

Move these definitions outside of the switch statement.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 lib.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib.c b/lib.c
index d232b8cee..7f7ca846b 100644
--- a/lib.c
+++ b/lib.c
@@ -1419,14 +1419,16 @@ static void predefined_macros(void)
 
 	case STANDARD_C11:
 	case STANDARD_GNU11:
-		predefine("__STDC_NO_ATOMICS__", 1, "1");
-		predefine("__STDC_NO_COMPLEX__", 1, "1");
-		predefine("__STDC_NO_THREADS__", 1, "1");
 		predefine("__STDC_VERSION__", 1, "201112L");
 		break;
 	}
 	if (!(standard & STANDARD_GNU) & (standard != STANDARD_NONE))
 		predefine("__STRICT_ANSI__", 1, "1");
+	if (standard >= STANDARD_C11) {
+		predefine("__STDC_NO_ATOMICS__", 1, "1");
+		predefine("__STDC_NO_COMPLEX__", 1, "1");
+		predefine("__STDC_NO_THREADS__", 1, "1");
+	}
 
 	predefine("__CHAR_BIT__", 1, "%d", bits_in_char);
 	if (funsigned_char)
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux