Skip to content

Commit 02a5337

Browse files
committed
Review bool type check
1 parent 46046bf commit 02a5337

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/physac.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,18 @@
106106
// NOTE: Below types are required for PHYSAC_STANDALONE usage
107107
//----------------------------------------------------------------------------------
108108
#if defined(PHYSAC_STANDALONE)
109+
// Boolean type
110+
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
111+
#include <stdbool.h>
112+
#elif !defined(__cplusplus) && !defined(bool)
113+
typedef enum { false, true } bool;
114+
#endif
115+
109116
// Vector2 type
110117
typedef struct Vector2 {
111118
float x;
112119
float y;
113120
} Vector2;
114-
115-
// Boolean type
116-
#if !defined(_STDBOOL_H)
117-
typedef enum { false, true } bool;
118-
#define _STDBOOL_H
119-
#endif
120121
#endif
121122

122123
typedef enum PhysicsShapeType { PHYSICS_CIRCLE, PHYSICS_POLYGON } PhysicsShapeType;

0 commit comments

Comments
 (0)