mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-08 12:57:14 +00:00
Remove more reserved identifiers (#6925)
This commit is contained in:
@@ -51,7 +51,7 @@ assert can have unique static variables associated with it.
|
||||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
|
||||
@@ -154,18 +154,18 @@
|
||||
#define SDL_FALLTHROUGH [[fallthrough]]
|
||||
#else
|
||||
#if defined(__has_attribute)
|
||||
#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
|
||||
#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
|
||||
#else
|
||||
#define _HAS_FALLTHROUGH 0
|
||||
#define SDL_HAS_FALLTHROUGH 0
|
||||
#endif /* __has_attribute */
|
||||
#if _HAS_FALLTHROUGH && \
|
||||
#if SDL_HAS_FALLTHROUGH && \
|
||||
((defined(__GNUC__) && __GNUC__ >= 7) || \
|
||||
(defined(__clang_major__) && __clang_major__ >= 10))
|
||||
#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
|
||||
#else
|
||||
#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
|
||||
#endif /* _HAS_FALLTHROUGH */
|
||||
#undef _HAS_FALLTHROUGH
|
||||
#endif /* SDL_HAS_FALLTHROUGH */
|
||||
#undef SDL_HAS_FALLTHROUGH
|
||||
#endif /* C++17 or C2x */
|
||||
#endif /* SDL_FALLTHROUGH not defined */
|
||||
|
||||
|
||||
@@ -122,11 +122,11 @@ extern "C" {
|
||||
|
||||
/* various modern compilers may have builtin swap */
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \
|
||||
# define HAS_BUILTIN_BSWAP16 (SDL_HAS_BUILTIN(__builtin_bswap16)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
|
||||
# define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \
|
||||
# define HAS_BUILTIN_BSWAP32 (SDL_HAS_BUILTIN(__builtin_bswap32)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \
|
||||
# define HAS_BUILTIN_BSWAP64 (SDL_HAS_BUILTIN(__builtin_bswap64)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
|
||||
/* this one is broken */
|
||||
|
||||
@@ -72,9 +72,9 @@ char *alloca();
|
||||
* instead of checking the clang version if possible.
|
||||
*/
|
||||
#ifdef __has_builtin
|
||||
#define _SDL_HAS_BUILTIN(x) __has_builtin(x)
|
||||
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
|
||||
#else
|
||||
#define _SDL_HAS_BUILTIN(x) 0
|
||||
#define SDL_HAS_BUILTIN(x) 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -694,7 +694,7 @@ SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if _SDL_HAS_BUILTIN(__builtin_mul_overflow)
|
||||
#if SDL_HAS_BUILTIN(__builtin_mul_overflow)
|
||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||
* because __builtin_mul_overflow() is type-generic, but we want to be
|
||||
* consistent about interpreting a and b as size_t. */
|
||||
@@ -724,7 +724,7 @@ SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if _SDL_HAS_BUILTIN(__builtin_add_overflow)
|
||||
#if SDL_HAS_BUILTIN(__builtin_add_overflow)
|
||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||
* the same as the call to __builtin_mul_overflow() above. */
|
||||
SDL_FORCE_INLINE int SDL_size_add_overflow_builtin (size_t a,
|
||||
|
||||
Reference in New Issue
Block a user