With __printf__, MinGW prefers the portable old ms-style printf, and
warns if formats like %lld and %hhd are used.
In practice, if __USE_MINGW_ANSI_STDIO is not defined, it defaults to 1
on C++11, and these formats are supported. Using __gnu_printf__
suppresses bad format warnings.
bits/os_defines.h has #define NOMINMAX 1, which conflicts with the
non-value #define NOMINXMAX in scummsys.h.
In file included from ../scummvm/common/lua/lua.h:12,
from ../scummvm/common/lua/ltable.cpp:27:
../scummvm/common/scummsys.h:111: warning: "NOMINMAX" redefined
111 | #define NOMINMAX
|
In file included from C:/msys64/mingw64/include/c++/10.2.0/x86_64-w64-
mingw32/bits/c++config.h:518,
from C:/msys64/mingw64/include/c++/10.2.0/cmath:41,
from C:/msys64/mingw64/include/c++/10.2.0/math.h:36,
from ../scummvm/common/lua/ltable.cpp:21:
C:/msys64/mingw64/include/c++/10.2.0/x86_64-w64-mingw32/bits/
os_defines.h:45: note: this is the location of the previous definition
45 | #define NOMINMAX 1
|
Amends commit 88f685217b1c8e7ab2c7a588677ad4744480b4a3.
This improves the output of static assertions in all compilers,
and prevents problems in MSVC 2015 where the mechanism for
triggering a compilation error in C++98 mode may cause errors when
that compiler builds in release mode.
Fixes Trac#10154.
This fixes compilation of sword25's pluto with Visual Studio. The issue
has been revealed with commit 34169a81. The other data types are
defined in scummsys.h, thus only the missing int64 and uint64 defines
are set.
Apparently their tools do not include __has_feature clang extension.
I've submitted the bugreport to them but in the meantime let's have this
define in the system.
This should fix compilation on mingw64 with --enable-c++11 and also make sure
the constants are present on other systems for the uncommon case they might be
missing.
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.
The header contains forbidden symbols on some platforms, and the
simplest solution seems to be to include it here. This also includes
it from all the portdefs.h files, except the Symbian one. Probably
the FIXME and the #if can be removed once it's known to work.