diff options
| author | Jonathan Poncelet <[email protected]> | 2022-05-19 20:21:09 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-19 21:21:09 +0200 |
| commit | 5bdd8f134ff3c2c91f953bc74311f804d957db2d (patch) | |
| tree | e492b7f436a98b0cb8f147e62300c2f9052e92a3 | |
| parent | 426e8252d4ce3a149360c225ed714aa9e649c1ea (diff) | |
| download | raylib-5bdd8f134ff3c2c91f953bc74311f804d957db2d.tar.gz raylib-5bdd8f134ff3c2c91f953bc74311f804d957db2d.zip | |
Improved boolean definitions (#2485)
| -rw-r--r-- | src/raudio.c | 4 | ||||
| -rw-r--r-- | src/raylib.h | 4 | ||||
| -rw-r--r-- | src/rgestures.h | 4 | ||||
| -rw-r--r-- | src/rlgl.h | 4 |
4 files changed, 6 insertions, 10 deletions
diff --git a/src/raudio.c b/src/raudio.c index 8cf15c9a..369fb852 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -247,10 +247,6 @@ typedef struct tagBITMAPINFOHEADER { #include "external/dr_flac.h" // FLAC loading functions #endif -#if defined(_MSC_VER) - #undef bool -#endif - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index 548b05fc..4e989795 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -177,10 +177,10 @@ // Structures Definition //---------------------------------------------------------------------------------- // Boolean type -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L +#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800) #include <stdbool.h> #elif !defined(__cplusplus) && !defined(bool) - typedef enum bool { false, true } bool; + typedef enum bool { false = 0, true = !false } bool; #define RL_BOOL_TYPE #endif diff --git a/src/rgestures.h b/src/rgestures.h index a40c41bc..d32ea25f 100644 --- a/src/rgestures.h +++ b/src/rgestures.h @@ -62,10 +62,10 @@ // NOTE: Below types are required for GESTURES_STANDALONE usage //---------------------------------------------------------------------------------- // Boolean type -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L +#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800) #include <stdbool.h> #elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE) - typedef enum bool { false, true } bool; + typedef enum bool { false = 0, true = !false } bool; #endif #if !defined(RL_VECTOR2_TYPE) @@ -358,11 +358,11 @@ typedef struct rlRenderBatch { float currentDepth; // Current depth value for next draw } rlRenderBatch; -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L +#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800) #include <stdbool.h> #elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE) // Boolean type - typedef enum bool { false, true } bool; +typedef enum bool { false = 0, true = !false } bool; #endif #if !defined(RL_MATRIX_TYPE) |
