mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-20 22:04:32 +00:00
Refactor warning diagnostic code to reduce repeated output logic
This commit is contained in:
+2
-5
@@ -9,8 +9,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "diagnostics.hpp" // fatalx
|
||||
#include "extern/getopt.hpp"
|
||||
#include "style.hpp"
|
||||
#include "usage.hpp"
|
||||
#include "util.hpp" // isBlankSpace
|
||||
|
||||
@@ -24,10 +24,7 @@ static std::vector<size_t>
|
||||
std::filebuf file;
|
||||
if (!file.open(path, std::ios_base::in)) {
|
||||
int errnum = errno;
|
||||
style_Set(stderr, STYLE_RED, true);
|
||||
fputs("FATAL: ", stderr);
|
||||
style_Reset(stderr);
|
||||
fprintf(stderr, "Failed to open at-file \"%s\": %s\n", path.c_str(), strerror(errnum));
|
||||
fatalx("Failed to open at-file \"%s\": %s", path.c_str(), strerror(errnum));
|
||||
usage.printAndExit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user