mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-24 06:37:07 +00:00
Refactor section creation errors, and simplify output for single errors (#1964)
This commit is contained in:
@@ -131,6 +131,16 @@ void fatal(char const *fmt, ...) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
void fatalNoTrace(std::function<void()> callback) {
|
||||
style_Set(stderr, STYLE_RED, true);
|
||||
fputs("FATAL: ", stderr);
|
||||
style_Reset(stderr);
|
||||
callback();
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void requireZeroErrors() {
|
||||
if (warnings.nbErrors != 0) {
|
||||
style_Set(stderr, STYLE_RED, true);
|
||||
|
||||
Reference in New Issue
Block a user