Fallback support for Boost.Foreach is broken and no one has reported it.
The minimum required gcc version supports range-based for. Recent Clang
supports range-based for. No Microsoft compilers are supported. Remove
support for the fallback Boost.Foreach and move the C++11 range-based
for test to the Cxx11RequiredFeature array.
Building with Boost.Array fails due to name lookup errors. These could
be fixed, but since no one has reported them and they are fairly old,
Boost.Array appears to be unused. Remove support for it.
Building with std::tr1::array fails due to missing features in
std::tr1:array relative to std::array. No one has reported this either,
so remove support for std::tr1:array.
Move the test for std::array into the Cxx11RequiredFeature list so that
it is run as part of the group test, rather than as a separate
statement.
GCC std::array uses std::size_t for its size_type. On Linux/amd64,
`std::size_t` is `unsigned long`. On Win32, `std::size_t` is
`unsigned int`. This provokes format string warnings because an
unsigned int is passed where the format string declares an unsigned
long. On Win32, `unsigned int` and `unsigned long` are the same size,
so `unsigned long` could have been used to avoid this problem by
maintaining consistency with Linux, but it was not. This may have been
an attempt to achieve bug compatibility with Microsoft's types.
Add a workaround by defining a macro DXX_PRI_size_type in the style of
inttypes.h PRI* macros. Use an SConf test to determine the correct
value by inspecting which compilation runs succeed. Currently, Linux
needs "l", Win32 needs "", and Win64 needs "I64".
Some tests may benefit from the results of earlier tests. Other tests
may give different results if the macros from earlier tests are defined.
SCons dependency checking rejects including dxxsconf.h during testing,
so save the results of self._check_macro and insert them into later
tests. Some tests define their macros in other ways. The macros from
those tests and are not yet inserted.
Boost enable_if works differently from std::enable_if, so the build is
broken when using Boost.TypeTraits. The broken code has been present
for a long time and no one reported it. Remove the fallback to Boost.
Windows 2000 has no support for getaddrinfo. Five years ago (Apr 5
2011), the addition of tracker support
(7f18afd5d7) brought a requirement for
getaddrinfo. Recently, someone with a working Windows 2000 system
reported that Rebirth no longer starts on Windows 2000. Although such
systems should not be connected to the Internet, they may still need
name resolution on a LAN. Add a configure test to probe for getaddrinfo
support and fall back to gethostbyname if needed.
Compiling a binary that works on Windows 2000 requires one of:
* using an ancient SDK that does not declare getaddrinfo
* defining _WIN32_WINNT to exclude Windows XP support
* overriding the SConf test to force failure
Fixes: 7f18afd5d7 ("Client-side implementation for Tracker support by Matt 1360 Vandermeulen including improvements in udp_dns_filladdr and IPv4/IPv6 compability; Very little adjustments by me, too including IPv6 support for Windows (untested); Actual tracker code will follow later as seperate branch when it's done")
Clang becomes confused trying to resolve X::a when:
- both `namespace ::X` and `class ::B::X` exist
- `using namespace B;` is active
even if class ::B::X is only a forward-declaration. Add an SConf test
to recognize when the compiler rejects this pattern and hide the safety
nets that are implemented using it.
Microsoft cmd.exe has strange quoting rules. Where other shells treat
single quote as a quote character, cmd.exe seems to pass it through to
the underlying process. This breaks the vers_id compilation with
strange error messages. In practice, SCons does not need the
no-interpolation semantics that single quote provides, so switch to
double quote for compatibility with Windows. This is probably slightly
less efficient on Bash, since it will now scan the value for expansions.
However, the efficiency loss is tiny compared to overhead elsewhere in
the build.
Per the documentation, on Linux, the default is true. On Windows,
setting it to true causes a Python exception because Windows relies on
disabling inheritance as a hack to close all descriptors, but
inheritance needs to be enabled to capture the output of the child
process.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/173>
Fixes: bb3f414128 ("Cache scons subprocess calls")
Move the boilerplate up onto the outer namespace line. Decorate each
collision with a comment stating its purpose, so that compiler error
output echoes the type of collision.
This started as a project to make SConstruct take less time on an empty
build. Unforunately, most of the major gains lie elsewhere and require
deeper changes to the build system. These changes do not help much, but
they are better than nothing.