aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorD G Turner2013-07-31 06:18:58 +0100
committerD G Turner2013-07-31 06:18:58 +0100
commit26a9b528dadde6521f80a7121af69f6af6f53b9a (patch)
tree66f97d412724e5b7b069e71fe021afd88eda6ef8 /common
parent1809cc567303651dd3acd54d64f0e7c33a2651df (diff)
downloadscummvm-rg350-26a9b528dadde6521f80a7121af69f6af6f53b9a.tar.gz
scummvm-rg350-26a9b528dadde6521f80a7121af69f6af6f53b9a.tar.bz2
scummvm-rg350-26a9b528dadde6521f80a7121af69f6af6f53b9a.zip
COMMON: Move definition of math constants to scummsys header.
This should have no effect on common/math.h as scummsys is included at the top anyway, but this will fix compilation on some toolchains when strict ANSI language compliance is enabled i.e. -std=c++11, rather than -std=gnu11. This causes an issue as a side effect is to set a guard which disables various non-standard defines in the system headers i.e. the M_PI and M_SQRT1_2 constant definitions in the MinGW x86_64 toolchain on buildbot. By moving this into scummsys.h after the point of system math.h inclusion, we can ensure that M_PI etc. are always present.
Diffstat (limited to 'common')
-rw-r--r--common/math.h8
-rw-r--r--common/scummsys.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/common/math.h b/common/math.h
index b85ec0d22a..ba137101e4 100644
--- a/common/math.h
+++ b/common/math.h
@@ -52,14 +52,6 @@
#endif
#endif
-#ifndef M_SQRT1_2
- #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-#endif
-
-#ifndef M_PI
- #define M_PI 3.14159265358979323846
-#endif
-
#ifndef FLT_MIN
#define FLT_MIN 1E-37
#endif
diff --git a/common/scummsys.h b/common/scummsys.h
index 291de87dc9..aeffbbfcf3 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -144,6 +144,14 @@
#endif
#endif
+#ifndef M_SQRT1_2
+ #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
+
+#ifndef M_PI
+ #define M_PI 3.14159265358979323846
+#endif
+
// Include our C++11 compatability header for pre-C++11 compilers.
#if __cplusplus < 201103L
#include "common/c++11-compat.h"