From 59c436c922b9f7fe9bfb0d595f17dee0330f289f Mon Sep 17 00:00:00 2001 From: Narice <31109099+Narice@users.noreply.github.com> Date: Wed, 1 May 2019 21:41:51 +0200 Subject: [PATCH 1/2] Defined PI (#822) PI is not always defined in math.h, thus it must be defined in this header --- src/easings.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/easings.h b/src/easings.h index 9ad27313..99685949 100644 --- a/src/easings.h +++ b/src/easings.h @@ -91,6 +91,7 @@ #endif #include // Required for: sin(), cos(), sqrt(), pow() +#define PI 3.14159265358979323846 //Required as PI is not always defined in math.h #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -250,4 +251,4 @@ EASEDEF float EaseElasticInOut(float t, float b, float c, float d) } #endif -#endif // EASINGS_H \ No newline at end of file +#endif // EASINGS_H From a54af067c2c2c5ef11c39fdf8f0b00e029e663d1 Mon Sep 17 00:00:00 2001 From: Narice <31109099+Narice@users.noreply.github.com> Date: Wed, 1 May 2019 22:03:32 +0200 Subject: [PATCH 2/2] Added guards to PI define Added guards to not redefine it if the user is using it with raylib.h also added an 'f' at the end of the define to keep compliant with raylib's PI define --- src/easings.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/easings.h b/src/easings.h index 99685949..810aeccb 100644 --- a/src/easings.h +++ b/src/easings.h @@ -91,7 +91,10 @@ #endif #include // Required for: sin(), cos(), sqrt(), pow() -#define PI 3.14159265358979323846 //Required as PI is not always defined in math.h + +#ifndef PI + #define PI 3.14159265358979323846f //Required as PI is not always defined in math.h +#endif #ifdef __cplusplus extern "C" { // Prevents name mangling of functions