diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-07-08 19:43:56 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-07-08 19:43:56 +0000 |
commit | c824be5b62a18de538ab93b2c8f3b33ecdb5eec2 (patch) | |
tree | f96a9b77ddf2dc7c34ff80947a2ddca5faf76394 /src | |
parent | e84b6f17072db98fff209fb10a12fe18f5916693 (diff) | |
download | plus-c824be5b62a18de538ab93b2c8f3b33ecdb5eec2.tar.gz plus-c824be5b62a18de538ab93b2c8f3b33ecdb5eec2.tar.bz2 plus-c824be5b62a18de538ab93b2c8f3b33ecdb5eec2.tar.xz plus-c824be5b62a18de538ab93b2c8f3b33ecdb5eec2.zip |
Fix: MSYS on Windows has no M_PI?
Maybe a more "proper" fix would be to #define _USE_MATH_DEFINES before including math.h: https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170
However:
1) SDL rotozoom already does it this way
2) Meway said: There is a way to do it more properly but it doesn't seem that its supported my msys however the above works.
**** mana/verse!209
Co-authored-by: Meway <mewaysid92@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/palette.cpp | 5 | ||||
-rw-r--r-- | src/particle/particleemitterprop.h | 5 | ||||
-rw-r--r-- | src/sdl2gfx/SDL2_rotozoom.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index c98a9416e..f0f97b6f1 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -33,6 +33,11 @@ #include "debug.h" +// required by MSYS2 / Windows +#ifndef M_PI +#define M_PI 3.1415926535897932384626433832795 +#endif + const Color Palette::BLACK = Color(0, 0, 0, 255); Palette::Palettes Palette::mInstances; diff --git a/src/particle/particleemitterprop.h b/src/particle/particleemitterprop.h index d82f188ac..0d1f9e5cb 100644 --- a/src/particle/particleemitterprop.h +++ b/src/particle/particleemitterprop.h @@ -30,6 +30,11 @@ #include "localconsts.h" +// required by MSYS2 / Windows +#ifndef M_PI +#define M_PI 3.1415926535897932384626433832795 +#endif + template <typename T> struct ParticleEmitterProp final { ParticleEmitterProp() : diff --git a/src/sdl2gfx/SDL2_rotozoom.h b/src/sdl2gfx/SDL2_rotozoom.h index ffab24fbc..abf1305f5 100644 --- a/src/sdl2gfx/SDL2_rotozoom.h +++ b/src/sdl2gfx/SDL2_rotozoom.h @@ -40,6 +40,7 @@ extern "C" { #endif +// required by MSYS2 / Windows #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif |