From d3c50147cb6a8df5ce797cab63da3e956d822c50 Mon Sep 17 00:00:00 2001 From: Carsten Hartenfels Date: Wed, 19 Sep 2018 20:42:05 +0200 Subject: [PATCH] Replace non-standard M_PI* constants with literals M_PI, M_PI_2 and M_PI_4 aren't part of the C standard. If you put your gcc into strict standards mode, like `-std=c11`, you won't get these constants and including cglm.h will fail. This commit replaces those constants with their literal values. The cast to a float remains, to keep exactly the same behavior as before. --- include/cglm/types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cglm/types.h b/include/cglm/types.h index 76c3646..49b65e4 100644 --- a/include/cglm/types.h +++ b/include/cglm/types.h @@ -48,8 +48,8 @@ typedef CGLM_ALIGN_IF(16) vec4 mat4[4]; typedef vec4 versor; -#define CGLM_PI ((float)M_PI) -#define CGLM_PI_2 ((float)M_PI_2) -#define CGLM_PI_4 ((float)M_PI_4) +#define CGLM_PI ((float)3.14159265358979323846) +#define CGLM_PI_2 ((float)1.57079632679489661923) +#define CGLM_PI_4 ((float)0.78539816339744830962) #endif /* cglm_types_h */