The NDS and AmigaOS ports have frequent buildbot issues, because they
need to use 'long' for int32, for their own reasons. The buildbot is
run *after* things are merged into the main branch, so we'd like to
catch the frequent int/int32 build issues as an earlier development
stage (such as by the automated Github Actions).
MSVC 32-bit builds look like a good candidate for this, since its
'long' is also a 32-bit value on Win32, this platform is tested by
Github Actions right from the PR stage, and there are more developers
doing frequent local build tests there.
Not applying this change to Mingw builds yet, since GCC is less
permissive about this trick (i.e. -Wformat becomes quite noisy), and
the Mingw builds are used for releases, so let's be safe for now.
toupper() callers should avoid putting a side-effect expression there, but
in practice it sometimes happen, so making the macro safer can't hurt.
This uses a GCC statement expression, but this port only uses GCC
anyway.
C++11 is now required, so there's no point in checking for pre-C++11
versions of GCC anymore. Note that Clang defines __GNUC__ too, but
always reports itself as GCC-4.2.1-compatible (and, in practice, the
earliest C++11-compatible versions of Clang will also be have most
GCC 4.8 features).
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 88f685217b.
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.