scummvm/scummvm — pull request #363 by digitall (2013-07-31 05:24:43+00:00)
Title: Fix compilation with C++11 enabled on Win64 x86_64 toolchain... and probably others.

The following is a possible solution, which should be workable and limited in scope. It should also work if you left math.h alone and just added the patch to scummsys.h, though this is undesirable as two definitions would be present in our codebase (violation of DRY principle).

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.