Last active
July 31, 2020 07:52
-
-
Save sleiner/3cf61abe32df02a36eb1dc9c896ddd3c to your computer and use it in GitHub Desktop.
Testing for GCC compile-time constants quickly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tests compile constants in GCC */ | |
#define STR_HELPER(x) #x | |
#define STR(x) STR_HELPER(x) | |
#if defined(__STDC_VERSION__) | |
#pragma message STR(__STDC_VERSION__) | |
#else | |
#pragma message "__STDC_VERSION__ not defined" | |
#endif | |
#if defined(__STRICT_ANSI__) | |
#pragma message STR(__STRICT_ANSI__) | |
#else | |
#pragma message "__STRICT_ANSI__ not defined" | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment