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.
This commit is contained in:
Carsten Hartenfels
2018-09-19 20:42:05 +02:00
parent 98da3daf82
commit d3c50147cb

View File

@@ -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 */