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:
Ryan C. Gordon
2025-05-30 15:58:44 -04:00
parent 51dfca813b
commit 6a686185f7

View File

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