Patch Author: Safety0ff
fixes ticket:2300
Original detective work done by Ai_Tak (ticket:1656)
Signed-off-by: buginator <buginator@gna.org>
(cherry picked from commit 1a6fb8a7547f23ce2bd7af153ac839cba999e2b0)
Currently, we have 1 atexit for our main shutdown routine, and 1 atexit call for the exception handler.
Fix mem leak for mod list.
Also dump allocator stats for MSVC people
2.3: r10251
refs ticket:1673
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10262 4a71c877-e1ca-e34f-864e-861f7616d084
This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.
Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.
LOG_FATAL is *always* on in both debug & release builds.
On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message. At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.
That explains why this touches ~60 files :)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
In C++ enums are treated differently from integers in some cases, causing GCC to emit some rather nasty abort()-like code (x86/x64 instruction "ud2a") when used as the type for va_arg().
This was the compiler message generated:
{{{
stack.c:339: warning: ‘INTERP_TYPE’ is promoted to ‘int’ when passed through ‘...’
stack.c:339: note: (so you should pass ‘int’ not ‘INTERP_TYPE’ to ‘va_arg’)
stack.c:339: note: if this code is reached, the program will abort
}}}
NOTE: Compiling as C++ now works (as does the produced code), using: {{{./configure CC=g++ CFLAGS=-fpermissive --enable-debug=relaxed}}}
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6957 4a71c877-e1ca-e34f-864e-861f7616d084
Extension functions dealing with ...
* strings are in string_ext.h
* stdio (namely printf variants) are in stdio_ext.h
* math are in math_ext.h
These headers are no longer included by frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
- This reduces the complexity of those functions ''significantly''
* Mark yyerror functions with printf formatting with WZ_DECL_FORMAT(printf, ...)
(@trunk = the original intented target for r6430)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6432 4a71c877-e1ca-e34f-864e-861f7616d084
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
* Missing returns from function
* Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
* Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
* Remove redundant function prototypes
* Move variables into a more local scope where possible
* Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
* Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
* Const correctness
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
* The lexers depend on the parser's headers so make sure to compile the parsers first
* Move a misplaced line-wrapping backslash in src/makefile.win32
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084