From 6572d5ff8c3299d3915f2b3155ef2275baa971fd Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 7 Oct 2018 00:34:50 +0200 Subject: [PATCH] raylib.h: include if available Previously, if was #included prior to another header that defined bool, the compilation would fail. This is e.g. the case for and which both fall back to the if C99 is available. The following commit includes in src/core.c, which causes the same problem. Avoid this by checking for C99 bool like we already do for C++'s. --- src/raylib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 17c4234e3..20a3ca267 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -354,11 +354,11 @@ //---------------------------------------------------------------------------------- // Structures Definition //---------------------------------------------------------------------------------- -#ifndef __cplusplus // Boolean type - #ifndef bool - typedef enum { false, true } bool; - #endif +#if defined(__STDC__) && __STDC_VERSION__ >= 199901L + #include +#elif !defined(__cplusplus) && !defined(bool) + typedef enum { false, true } bool; #endif // Vector2 type