Commit Graph
20 Commits
Author SHA1 Message Date
Geoffrey McRae c100df4037 [all] common: debug assert should always abort 2023-10-27 17:32:58 +11:00
Geoffrey McRae 2e515657dd [all] update/add license headers 2023-10-20 15:36:34 +11:00
Geoffrey McRae 952ebea2c5 [all] refresh copyright dates 2022-01-05 19:42:46 +11:00
Geoffrey McRae 2ed3c82de0 [common] provide debug print methods for dependent libraries to use 2021-12-29 16:01:42 +11:00
Quantum 778d27f08a [common] debug: fix incorrect use of #elif defined 2021-09-29 17:48:03 +10:00
Quantum a9241f6710 [common] debug: add DEBUG_UNREACHABLE() macro
This lets us mark code as unreachable and signals the compiler that this
is the case with __builtin_unreachable().

We also mark DEBUG_FATAL as unreachable.
2021-08-14 12:19:07 +10:00
Quantum be1306f91a [common] debug: add DEBUG_ASSERT macro
This, unlike the standard assert macro, is guaranteed to print the failed
assertion to our log file, and tests the assertion even with NDEBUG defined
so we can more easily catch failures in production binaries without crashing
the program.

The motivation of this is how MinGW handles assertion failures: it creates a
dialog window that the headless user will not be able to see, and blocks the
program from being restarted by the service. Since the failed assertion is
displayed in the dialog, it doesn't print anything to the log, making it
impossible to diagnose issues.
2021-08-14 12:19:07 +10:00
Quantum 51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
Geoffrey McRae 0acce0737f [common] debug: output to stdout and reset the the color at the end 2021-07-08 07:18:06 +10:00
Geoffrey McRae 54d0dc351b [common] debug: remove missed debug_print forward 2021-07-07 23:08:47 +10:00
Geoffrey McRae 1effd5fddc [common] debug: add color support to debug messages
People often miss the warnings about invalid arguments in their command
line, this last minute patch attempts to address this by making
warnings, errors, fixme's and fatal errors stand out if stdout is a TTY.
2021-07-07 23:05:46 +10:00
Quantum 24d0aa0c18 [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
Quantum b00c25a822 [common] crash: fix Linux compilation with -DENABLE_BACKTRACE=NO
Essentially, debug.h defines printTrace as an empty macro when the macro
ENABLE_BACKTRACE is not defined, breaking the compilation of crash.c.

Fixed by defining a private macro for debug.h only to avoid clashing.
2021-03-03 16:36:50 +11:00
Geoffrey McRae bf583290a4 [client/common] restructure project in prep for full SDL removal 2021-02-21 10:31:46 +11:00
Geoffrey McRae 6f1c19b3b0 [all] improve backtrace and debugging support 2021-02-21 10:30:57 +11:00
Geoffrey McRae be7820303f [common] fixed debug formatting across platforms 2020-08-03 15:05:35 +10:00
Geoffrey McRae b7ca3d7e37 [client] cleanup debug output 2020-05-17 11:25:27 +10:00
Geoffrey McRae 6e62ea5364 [common] fix building on mingw for linux 2020-01-28 05:10:38 +11:00
Geoffrey McRae 29e5f193f0 [common] added timestamps to log output 2020-01-28 03:57:19 +11:00
Geoffrey McRae 28b12c85f4 [build] make "common" a static library (part 1/2) 2019-04-11 11:03:30 +10:00