From 16fcaf7fc01f93e430a5ab6b589c3178b9854ad4 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Thu, 8 Jun 2023 06:28:40 +0300 Subject: [PATCH] Update types-struct.h --- include/cglm/types-struct.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/cglm/types-struct.h b/include/cglm/types-struct.h index 1d91097..d581fca 100644 --- a/include/cglm/types-struct.h +++ b/include/cglm/types-struct.h @@ -25,10 +25,17 @@ * 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 -# elif __STDC_VERSION__ >= 20112L || defined(_MSVC_VER) +# elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(__cplusplus) && __cplusplus >= 201103L) /* We're compiling for C11 or this is the MSVC compiler. In either * case, anonymous structs are available, so use them. */ # define CGLM_USE_ANONYMOUS_STRUCT 1 +# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + /* GCC 4.6 and onwards support anonymous structs as an extension */ +# define CGLM_USE_ANONYMOUS_STRUCT 1 +# elif defined(__clang__) && __clang_major__ >= 3 + /* Clang 3.0 and onwards support anonymous structs as an extension */ +# define CGLM_USE_ANONYMOUS_STRUCT 1 # elif defined(_MSC_VER) && (_MSC_VER >= 1900) /* Visual Studio 2015 */ /* We can support anonymous structs * since Visual Studio 2015 or 2017 (1910) maybe? */