Rename symbol OGL to DXX_USE_OGL to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -lzw OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
Rename symbol OGLES to DXX_USE_OGLES to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -lzw OGLES -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGLES/\1 DXX_USE_OGLES/' -e 's/\(\s*#\s*if\)ndef OGLES/\1 !DXX_USE_OGLES/'
Previously this could be achieved by setting the install path to @executable_path/../Frameworks/<path to framework> for each framework or library, but for Mac OS X 10.5 onwards, these frameworks (namely SDL and SDL_mixer) are set by default to install to @rpath for greater flexibility. @rpath is then set by the binary, in this case DXX-Rebirth to @loader_path/../Frameworks via SCons.
On Mac OS X it is common practice to distribute applications with any frameworks or libraries specific to that application within the application bundle.
clang on OS X incorrectly diagnoses mistakes in Apple system headers
even when -Wsystem-headers is not specified. Move -Wold-style-cast from
the forced CXXFLAGS section to an SConf test that includes one of the
deficient headers. This should cause SConf to declare OS X clang as
unable to use -Wold-style-cast, which is necessary to avoid spurious
failures when including Apple headers that use old style casts.
`std::use_facet` is provided by `<locale>`. x86_64-pc-linux-gnu happens
to provide `std::use_facet` in inferno.cpp without explicitly including
`<locale>`. kreator found that clang on OS X does not implicitly
provide `<locale>`. `<locale>` must be included to make
`std::use_facet` available on OS X. Although it worked without this on
Linux, it is the right thing to do everywhere.
Unlike many uses of index_sequence<N...>, this set of N... is not the
result of make_tree_index_sequence. Some callers pass sequences with
`Nn != n` for some n, so vp is not initialized as a copy of all elements
of ovp in the same order as ovp.
Fixes: fa5475aa54 ("Remove unnecessary copy of vertex points")
clang crashes with a segmentation fault if asked to implicitly convert
1u to std::size_t in partial_range inline chain. Add a conversion
outside the inline chain, which seems to avoid the bug.
The legacy UDP tracker does not need either curl or jsoncpp.
The new HTTP tracker requires both. Add tests for both, guarded by
`use_tracker`. Force `use_tracker` to False for now. When the HTTP
tracker is made active, remove the assignment so that use_tracker=1 will
enable the new tests.
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
Rename symbol IPv6 to DXX_USE_IPv6 to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -wl IPv6 -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(IPv6\)$/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(IPv6\))/#\1if \2DXX_USE_\3/'
Rename symbol USE_UDP to DXX_USE_UDP to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -l USE_UDP -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(USE_UDP\)$/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(USE_UDP\))/#\1if \2DXX_\3/'
Rename symbol USE_TRACKER to DXX_USE_TRACKER to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -l USE_TRACKER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_TRACKER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_TRACKER\))/#\1if \2DXX_\3/'
Rename symbol USE_SDLMIXER to DXX_USE_SDLMIXER to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct and
inferno.cpp were manual.
git grep -l USE_SDLMIXER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_SDLMIXER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_SDLMIXER\))/#\1if \2DXX_\3/'
clang does not understand -Wuseless-cast. Passing -Wuseless-cast to
clang causes clang to fail the compile. Resolve this by adding an SConf
test for -Wuseless-cast instead of adding it unconditionally. It cannot
be put in the compiler preferred options tuple since it must be set
before the test for whether casting a ptrdiff to int is useless.
It was a convenient transition macro, but its presence was always
intended to be temporary. Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
The folded form combined multiple targets into one, which is not the
desired result.
'''
unfolded
l=['gcc5,', 'mingw5,'] e='gcc5,' p=('gcc5', '')
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('mingw5', '')
folded
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('gcc5', '', 'mingw5', '')
'''
import itertools
l = ['gcc5,', 'mingw5,']
print('unfolded')
for e in l:
for p in itertools.product(*[v.split('+') for v in e.split(',')]):
print("l=%r e=%r p=%r" % (l, e, p))
print('folded')
for p in itertools.product(*[
v.split('+') \
for e in l \
for v in e.split(',') \
]):
print("l=%r e=%r p=%r" % (l, e, p))
Casting `&unsigned` to `(unsigned long *)` is wrong. It happened to
work because these types are the same size on Windows and this code is
only used on Windows. Remove the bogus cast and fix the function
prototype.
<=gcc-5 with -Wold-style-cast warn when expansions of SDL macro
CD_INDRIVE produce an old style cast, even though the cast comes from a
system header. Undefine it and define an equivalent that uses a C++
cast, so that uses do not provoke a warning.