Refactor section creation errors, and simplify output for single errors (#1964)

This commit is contained in:
Rangi
2026-05-21 13:01:08 -04:00
committed by GitHub
parent 728d14879b
commit d56dbbb4bf
20 changed files with 132 additions and 87 deletions
+10
View File
@@ -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);