take -pedantic into account to validate CGLM_USE_ANONYMOUS_STRUCT

This commit is contained in:
Recep Aslantas
2024-08-27 11:58:34 +03:00
parent 48839a38a1
commit f82d570dec

View File

@@ -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)