mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user