splitpath_t is designed for MS-DOS paths, even though Rebirth now runs
on many platforms that never used DOS conventions. Most of the members
of splitpath_t are unused on all platforms. Remove them, and switch to
returning an initialized version of the structure.
The type aliases are sufficient. Individual bytebuffer_t
implementations can define a `static constexpr` member `endian` from the
type alias and rely on `std::integral_constant<T, V>::operator()`
instead of defining a `static` method just to return an instance of the
`std::integral_constant`.
Rework the error paths to return path-specific status codes so that the
caller can report exactly which step caused an HMP file to be rejected.
On error, print this reason numerically and, if the reason was a PhysFS
error, also print the PhysFS error code numerically and symbolically.
Some targets only ever use GUI warn functions. On those targets:
- initialize `warn_func` to `msgbox_warning` at compile time
- remove the runtime initialize of warn_func in main
On targets which do not call `clear_warn_func`, preprocess out its
declaration and definition.
Taken together, these changes allow some targets not to define
`warn_printf`.
Previously, if SDL_AllocRW failed, then the handle would not be saved
into an SDL_RWops (since that object was not created), but it would also
not be closed immediately.
This adds a new dependency, but most systems likely already have
SDL_image installed. Use of SDL_image can be disabled, but this is
discouraged, because various in-game interfaces assume the use of the
original background.
The old implementation automatically corrected for filename case. The
new implementation expects that the supplied filename can be passed to
PYHSFS_openRead as-is. All known uses in-game have been corrected to
satisfy this requirement. If the new stricter match requirement becomes
a problem, a variant of PHYSFSRWOPS_openRead that adjusts filename case
could be created for use here.
- Update install instructions
- Update ebuild
- Update Arch PKGBUILD
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it. These domains were converted:
* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
On Windows, the hook function blocks until the user dismisses the
message box. Print the message before opening the message box so that
it is available on the console, if one exists.
- Add wrappers for PHYSFS_read and its convenience functions. Poison
the memory before calling PHYSFS, so that any uninitialized bytes
(likely caused by a short read) are reported if the caller tries to
access the value anyway.
- Add SConstruct options to enable wrapping, so that users do not need
to enumerate the wrapped functions manually.
- Fix link failure when using LTO+wrappers.
PCH mode causes the Valgrind-wrapper header to be included in places
it is not meant to be used, which leads to spurious compiler errors.
PCH mode causes the Valgrind-wrapper __real_* stub functions to see
the physfsx.h PHYSFS macros, which also causes errors.
Fortunately, both cases can be easily fixed.
Add preprocessor guards to the Valgrind-wrapper header to cause it to
compile out when the PCH phase runs. It has no include guard, so it
will be rescanned with the proper macros when the two consuming files
are built normally.
Modify the Valgrind-wrapper __real_* stub functions to use
the standard macro avoidance trick so that they do not call the
physfsx.h PHYSFS macros.
Clang rejects a declared (but never defined and never used) `static`
function. Change the declaration to be the value of a macro that will
be expanded only when the function is both defined and used.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/295>
Fixes: 55822d0b4d ("Add wrappers for more precise Valgrind physfs diagnostics")
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.