mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 07:16:00 +00:00
SDL_begin_code.h: Actually define SDL_RESTRICT.
We wrote documentation for this but never actually filled in the code.
This commit is contained in:
@@ -261,9 +261,9 @@
|
||||
*
|
||||
* On compilers without restrict support, this is defined to nothing.
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
* \since This macro is available since SDL 3.4.0.
|
||||
*/
|
||||
#define SDL_RESTRICT __restrict__
|
||||
#define SDL_RESTRICT __restrict
|
||||
|
||||
/**
|
||||
* Check if the compiler supports a given builtin functionality.
|
||||
@@ -325,6 +325,17 @@
|
||||
/* end of wiki documentation section. */
|
||||
#endif
|
||||
|
||||
/* `restrict` is from C99, but __restrict works with both Visual Studio and GCC. */
|
||||
#ifndef SDL_RESTRICT
|
||||
# if defined(restrict) || ((defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901)))
|
||||
# defined SDL_RESTRICT restrict
|
||||
# elif defined(_MSC_VER) || defined(__GNUC__) || defined(__clang__)
|
||||
# define SDL_RESTRICT __restrict
|
||||
# else
|
||||
# define SDL_RESTRICT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HAS_BUILTIN
|
||||
#ifdef __has_builtin
|
||||
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
|
||||
|
Reference in New Issue
Block a user