macro: EDG compiler frontends doesn't support enum types

It declares STDC_VERSION 202311L but still doesn't support this feature:

https://en.cppreference.com/w/c/compiler_support/23

The EDG frontend is used by intellisense, which is the default
engine in VSCode, so parsing is currently broken and tons of
spurious errors are shown. Skip this feature when this
compiler frontend is used.

Follow-up for 92100f14c3
This commit is contained in:
Luca Boccassi
2025-07-03 01:23:31 +01:00
parent 942cb8a7c0
commit e01ca3afdb
2 changed files with 2 additions and 2 deletions

View File

@@ -472,7 +472,7 @@ assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
/* In GCC 14 (C23) we can force enums to have the right types, and not solely rely on language extensions anymore */
#if __GNUC__ >= 14 || __STDC_VERSION__ >= 202311L
#if (__GNUC__ >= 14 || __STDC_VERSION__ >= 202311L) && !defined(__EDG__)
# define ENUM_TYPE_S64(id) id : int64_t
#else
# define ENUM_TYPE_S64(id) id

View File

@@ -117,7 +117,7 @@ typedef void (*_sd_destroy_t)(void *userdata);
_SD_##id##_INT64_MAX = INT64_MAX
/* In GCC 14 (C23) we can force enums to have the right types, and not solely rely on language extensions anymore */
#if ((__GNUC__ >= 14) || (__STDC_VERSION__ >= 202311L)) && !defined(__cplusplus)
#if ((__GNUC__ >= 14) || (__STDC_VERSION__ >= 202311L)) && !defined(__cplusplus) && !defined(__EDG__)
# define _SD_ENUM_TYPE_S64(id) id : int64_t
#else
# define _SD_ENUM_TYPE_S64(id) id