From 32fd1878a090296239a55ed53887a563a0247513 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 18 Sep 2024 10:36:36 -0700 Subject: [PATCH] Provide a definition of bool if needed for your environment --- include/SDL3/SDL_stdinc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 836eb77c33..f1c411b0c1 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -34,13 +34,25 @@ #include +/* Most everything except Visual Studio 2013 and earlier has stdbool.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1910) +#define SDL_DEFINE_STDBOOL +#endif + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include #endif #include #ifndef __cplusplus +#if defined(SDL_DEFINE_STDBOOL) && !defined(__bool_true_false_are_defined) +#define __bool_true_false_are_defined 1 +#define bool int8_t +#define false 0 +#define true 1 +#else #include #endif +#endif #include #include #include