This is the last compiler setup we have, that was missing a warning
counter. Initial limit we use is different than number reported by MSVC
internally, because MSVC simply sums warnings from all projects (without
removing duplicates, the way our script does).
There's no reason to copy strings back and forth in here - libpng will
use the pointers we'll pass, and we know all lengths at compile time.
To verify, make a screenshot and use ImageMagick to display strings:
$ identify -verbose dosbox_001.png | grep Software
"Software" is one of few built-in libpng keywords, but it does not seem
to be very popular.
The correct way to cleanup after SDL_Init is to call
"atexit(SDL_Quit);", so all SDL internals are correctly closed, even in
abnormal circumstances.
See: https://wiki.libsdl.org/SDL_Quit
However, when using SDL_VIDEODRIVER=wayland (as of SDL 2.0.12), this
causes crash in SDL, as MESA might've cleaned up some of driver
internals already.
Replace useless SDL_Init_Wrapper with simpler SDL_Init, and create
wrapper for SDL_Quit to accomodate multiple exit scenarios (those
triggered by erros, but also by window managers or directly by users).
Directly call SDL_Quit before atexit queue to prevent crash on normal
process termination (leaving main); the crash was not happening when
process terminates due to exit syscall.
This change fixes compilation on devkit pro toolchain; it's a GCC
cross-compiler targeting PPC intended for homebrew development for
various Nintendo devices (like GameCube).
Signed-off-by: Nikos Chantziaras <realnc@gmail.com>
Signed-off-by: Patryk Obara <dreamer.tan@gmail.com>
This commits covers a single class of string-cat
issues, all of which involve writing an unchecked
quantity of bytes into a string of a fixed length (ie:
char[]).
Things aren't perfect, but they're the best we can do given what we're
left to work with. For example:
- We cannot update the virus signatures, because that command simply
fails, despite being copy-and-paste'd from Microsoft's documentation.
- When queried, Windows reports its virus signature age is
4,294,967,295 days old, which, on geological time scales, pre-dates
even the Pleistocene era by 9.7 million years.
Despite these issues, my hunch is that the signatures are current as of
the date when the VM's base-image was generated; and because we're in
the Holocene era of zero-day network threats, my guess is GitHub is
re-generating images at least weekly if not more frequently (and sure
enough, Defender catches the EICAR dummy virus.
Note that we're not using Start-MpScan because it does not provide any
useful output on status of scans (indeed!), so I've moved that here into
the commit message.
In this case, the target string's head-pointer is
walked forward dynamically in the prior code, where
each increment reduces the remaining string-length
that's available into which to write.
We use pointer artithmetic to count how far the head
pointer has moved from the base (subtracting that from
the available length), but also adding a safety net to
never exceed the original length if the prior
pointer-moving code were go off the rails (and exceed
the max length).
The prior C-style casts are ambiguous when it comes to
describing what type of cast is being performed. In
this case, we're changing the undering the pointer type
(from an unsigned char * to a char *), which a simple
static_cast<...> cannot do.
This commits covers a single class of string-copy
issues, all of which involve writing an unchecked
quantity of bytes into a string of a fixed length (ie:
char[]).
No user expects, that editor name needs to be manually supplied, and
documentation is not clear about this either.
Add GNU-style double-dash long parameter. Unfortunately, --opt=value
style does not work with DOSBox non-standard parameter handling
implementation.
When user won't supply value for the parameter, following editors will
be tried in order:
- Program supplied via EDITOR environment variable
- nano
- vim
- vi
- notepad++.exe
- notepad.exe
Do not exit inside function, return error code instead.
Print error to stderr, and not stdout, to make life easier for users
invoking dosbox from within scripts.
Include double-dash GNU-style parameter: '--printconf'.
Setting up configuration file location is a dependency for:
$ dosbox -printconf
$ dosbox -editconf vim
$ dosbox -eraseconf
Wee need to have cache initialized before these parameters are handled.
v2 will:
- Checkout over SSH
- use Git's REST API, when git is version 2.18 or newer
- No longer detaches HEAD when checking out a branch
- Fetches one-commit deep by default
When building releases where we expect full history plus tags,
we explicitly get them with `git fetch --prune --unshallow`.
Shaders were previously saved as standard C++ string concatenations.
This commit converts them to the C++11 raw string syntax using a raw
string delimiter of `GLSL`.
This format is preferable as it will allow the shaders to be viewed and
edited directly, without having to make considerations for any escape
characters within the code.