[Scummvm-cvs-logs] scummvm master -> 5a7bba35ed5c4402d064d3cb95fef622a12b3001
lordhoto
lordhoto at gmail.com
Fri Aug 2 15:47:36 CEST 2013
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
26a9b528da COMMON: Move definition of math constants to scummsys header.
17ccd18ed3 COMMON: Add comment explaining reason for defining math constants.
5a7bba35ed Merge pull request #363 from digitall/EnsurePI
Commit: 26a9b528dadde6521f80a7121af69f6af6f53b9a
https://github.com/scummvm/scummvm/commit/26a9b528dadde6521f80a7121af69f6af6f53b9a
Author: D G Turner (digitall at scummvm.org)
Date: 2013-07-30T22:18:58-07:00
Commit Message:
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.
Changed paths:
common/math.h
common/scummsys.h
diff --git a/common/math.h b/common/math.h
index b85ec0d..ba13710 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 291de87..aeffbbf 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"
Commit: 17ccd18ed3a41702ac7de7e55fca09578f734ccb
https://github.com/scummvm/scummvm/commit/17ccd18ed3a41702ac7de7e55fca09578f734ccb
Author: D G Turner (digitall at scummvm.org)
Date: 2013-08-01T22:23:52-07:00
Commit Message:
COMMON: Add comment explaining reason for defining math constants.
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index aeffbbf..099b12b 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -144,6 +144,11 @@
#endif
#endif
+// The following math constants are usually defined by the system math.h header, but
+// they are not part of the ANSI C++ standards and so can NOT be relied upon to be
+// present i.e. when -std=c++11 is passed to GCC, enabling strict ANSI compliance.
+// As we rely on these being present, we define them if they are not set.
+
#ifndef M_SQRT1_2
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#endif
Commit: 5a7bba35ed5c4402d064d3cb95fef622a12b3001
https://github.com/scummvm/scummvm/commit/5a7bba35ed5c4402d064d3cb95fef622a12b3001
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2013-08-02T06:46:45-07:00
Commit Message:
Merge pull request #363 from digitall/EnsurePI
Fix compilation with C++11 enabled on Win64 x86_64 toolchain... and probably others.
Changed paths:
common/math.h
common/scummsys.h
More information about the Scummvm-git-logs
mailing list