this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Updated bool detection.

+12 -9
+12 -9
include/SDL_gpu.h
··· 24 24 #define SDL_GPU_USE_SDL1 25 25 #endif 26 26 27 - // Use bool type if available 28 - #if defined(_MSC_VER) 29 - // As of 2016, MSVC still doesn't have bool. 30 - #include <WinDef.h> 31 - #define GPU_bool BOOL 32 - #elif defined(__cplusplus) 27 + 28 + // Check for bool support 29 + #define GPU_HAVE_C99 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) 30 + #define GPU_HAVE_GNUC defined(__GNUC__) // catches both gcc and clang I believe 31 + #define GPU_HAVE_MSVC18 (defined(_MSC_VER) && (_MSC_VER >= 1800)) // VS2013+ 32 + 33 + #if defined(GPU_USE_REAL_BOOL) && GPU_USE_REAL_BOOL // allow user to specify 34 + #define GPU_bool bool 35 + #elif defined(GPU_USE_INT_BOOL) && GPU_USE_INT_BOOL 36 + #define GPU_bool int 37 + #elif GPU_HAVE_C99 || GPU_HAVE_GNUC || GPU_HAVE_MSVC18 || (defined(GPU_HAVE_STDBOOL) && GPU_HAVE_STDBOOL) 38 + #include <stdbool.h> 33 39 #define GPU_bool bool 34 - #elif __STDC_VERSION__ >= 199901L 35 - #define GPU_bool _Bool 36 40 #else 37 - // Fall back to compatibility with MSVC BOOL 38 41 #define GPU_bool int 39 42 #endif 40 43