From f82d570decded93592f86c62a8281ea0371fe928 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Tue, 27 Aug 2024 11:58:34 +0300 Subject: [PATCH] take -pedantic into account to validate CGLM_USE_ANONYMOUS_STRUCT --- include/cglm/types-struct.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/cglm/types-struct.h b/include/cglm/types-struct.h index 0a3ad0f..d93152e 100644 --- a/include/cglm/types-struct.h +++ b/include/cglm/types-struct.h @@ -24,6 +24,12 @@ /* The user has defined CGLM_NO_ANONYMOUS_STRUCT. This used to be the * only #define governing the use of anonymous structs, so for backward * compatibility, we still honor that choice and disable them. */ +# define CGLM_USE_ANONYMOUS_STRUCT 0 + /* Disable anonymous structs if strict ANSI mode is enabled for C89 or C99 */ +# elif defined(__STRICT_ANSI__) && \ + (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L)) + /* __STRICT_ANSI__ is defined and we're in C89 + * or C99 mode (C11 or later not detected) */ # define CGLM_USE_ANONYMOUS_STRUCT 0 # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ (defined(__cplusplus) && __cplusplus >= 201103L)