From 1f943663b8730c94ce737bb989f8f27e586ea0a1 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Sat, 17 Oct 2020 10:17:56 +1100 Subject: [PATCH] C89 requires __STDC__ to be defined, but not __STDC_VERSION__ gcc defines it anyway, but clang doesn't. Fixes #22. --- settings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.h b/settings.h index bd65b151..8dbcec5a 100644 --- a/settings.h +++ b/settings.h @@ -14,7 +14,7 @@ #if !defined(LIBCO_MP) /* Running in single-threaded environment */ #define thread_local #else /* Running in multi-threaded environment */ - #if defined(__STDC_VERSION__) /* Compiling as C Language */ + #if defined(__STDC__) /* Compiling as C Language */ #if defined(_MSC_VER) /* Don't rely on MSVC's C11 support */ #define thread_local __declspec(thread) #elif __STDC_VERSION__ < 201112L /* If we are on C90/99 */ @@ -55,7 +55,7 @@ - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). */ #if !defined(alignas) - #if defined(__STDC_VERSION__) /* C Language */ + #if defined(__STDC__) /* C Language */ #if defined(_MSC_VER) /* Don't rely on MSVC's C11 support */ #define alignas(bytes) __declspec(align(bytes)) #elif __STDC_VERSION__ >= 201112L /* C11 and above */