mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
RGBFIX returns 1 if there was a -Werror before processing any files
This commit is contained in:
@@ -7,20 +7,7 @@
|
||||
|
||||
#include "fix/warning.hpp"
|
||||
|
||||
[[gnu::format(printf, 1, 2), noreturn]]
|
||||
static void fatalWithMBCNames(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
fputs("FATAL: ", stderr);
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
putc('\n', stderr);
|
||||
|
||||
mbc_PrintAcceptedNames(stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void mbc_PrintAcceptedNames(FILE *file) {
|
||||
static void printAcceptedMbcNames(FILE *file) {
|
||||
fputs("Accepted MBC names:\n", file);
|
||||
fputs("\tROM ($00) [aka ROM_ONLY]\n", file);
|
||||
fputs("\tMBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)\n", file);
|
||||
@@ -45,6 +32,19 @@ void mbc_PrintAcceptedNames(FILE *file) {
|
||||
fputs("\tTPP1_1.0+BATTERY+TIMER+MULTIRUMBLE\n", file);
|
||||
}
|
||||
|
||||
[[gnu::format(printf, 1, 2), noreturn]]
|
||||
static void fatalWithMBCNames(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
fputs("FATAL: ", stderr);
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
putc('\n', stderr);
|
||||
|
||||
printAcceptedMbcNames(stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
bool mbc_HasRAM(MbcType type) {
|
||||
switch (type) {
|
||||
case ROM_RAM:
|
||||
@@ -241,7 +241,7 @@ MbcType mbc_ParseName(char const *name, uint8_t &tpp1Major, uint8_t &tpp1Minor)
|
||||
char const *fullName = name;
|
||||
|
||||
if (!strcasecmp(name, "help") || !strcasecmp(name, "list")) {
|
||||
mbc_PrintAcceptedNames(stdout);
|
||||
printAcceptedMbcNames(stdout);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user