mirror of https://github.com/raysan5/raylib
REVIEWED: Avoid bool type collisions
This commit is contained in:
parent
0f8cfd6031
commit
b805754aa1
10
src/raylib.h
10
src/raylib.h
|
@ -102,9 +102,12 @@
|
||||||
#ifndef PI
|
#ifndef PI
|
||||||
#define PI 3.14159265358979323846f
|
#define PI 3.14159265358979323846f
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef DEG2RAD
|
||||||
#define DEG2RAD (PI/180.0f)
|
#define DEG2RAD (PI/180.0f)
|
||||||
#define RAD2DEG (180.0f/PI)
|
#endif
|
||||||
|
#ifndef RAD2DEG
|
||||||
|
#define RAD2DEG (180.0f/PI)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Allow custom memory allocators
|
// Allow custom memory allocators
|
||||||
#ifndef RL_MALLOC
|
#ifndef RL_MALLOC
|
||||||
|
@ -184,6 +187,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#elif !defined(__cplusplus) && !defined(bool)
|
#elif !defined(__cplusplus) && !defined(bool)
|
||||||
typedef enum bool { false, true } bool;
|
typedef enum bool { false, true } bool;
|
||||||
|
#define RL_BOOL_TYPE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Vector2, 2 components
|
// Vector2, 2 components
|
||||||
|
|
|
@ -291,7 +291,7 @@ typedef struct rlRenderBatch {
|
||||||
|
|
||||||
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
|
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#elif !defined(__cplusplus) && !defined(bool)
|
#elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE)
|
||||||
// Boolean type
|
// Boolean type
|
||||||
typedef enum bool { false, true } bool;
|
typedef enum bool { false, true } bool;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue