SDL_HAS_BUILTIN(3)
β¨ SDL_HAS_BUILTIN(3) β¨
okay so this one's from the SDL3 FUNCTIONS manual, and it's literally the cutest lil preprocessor vibe check for builtin compiler stuff π
πΈ NAME πΈ
SDL_HAS_BUILTIN β check if the compiler supports a given builtin functionality.
π SYNOPSIS π
#include <SDL3/SDL_begin_code.h>
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
π¦ DESCRIPTION π¦
okay bestie, here's the tea: this lets you do preprocessor checks for things that otherwise might fail to compile. no cap π
It's supported by virtually all clang versions and more-recent GCCs. So if you can, use this instead of checking the clang version. iykyk β¨
On compilers without has_builtin support, this is defined to 0 (always false). periodt π
π AVAILABILITY π
This macro is available since SDL 3.2.0. π«Ά
xoxo, your SDL bestie π β source/version: Simple Directmedia Layer, SDL 3.4.18, page SDL_HAS_BUILTIN(3) π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms