raylib.h: include <stdbool.h> if available
Previously, if <raylib.h> was #included prior to another header that defined bool, the compilation would fail. This is e.g. the case for <perl.h> and <objc/objc.h> which both fall back to the <stdbool.h> if C99 is available. The following commit includes <objc/objc.h> in src/core.c, which causes the same problem. Avoid this by checking for C99 bool like we already do for C++'s.
This commit is contained in:
parent
a56b3c2194
commit
6572d5ff8c
1 changed files with 4 additions and 4 deletions
|
@ -354,11 +354,11 @@
|
|||
//----------------------------------------------------------------------------------
|
||||
// Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
#ifndef __cplusplus
|
||||
// Boolean type
|
||||
#ifndef bool
|
||||
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
|
||||
#include <stdbool.h>
|
||||
#elif !defined(__cplusplus) && !defined(bool)
|
||||
typedef enum { false, true } bool;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Vector2 type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue