Files
James Petersen 78c1991f31
Some checks failed
build / build (push) Has been cancelled
Transition to compiled arm7 binary (#1247)
Co-authored-by: Rachel <rachel@lhea.me>
2026-08-11 02:36:58 -04:00

33 lines
1.1 KiB
C

// SPDX-License-Identifier: MIT
#ifndef NITROROM_H
#define NITROROM_H
#define die(__msg, ...) \
{ \
fputs(PROGRAM_NAME ": ", stderr); \
fprintf(stderr, __msg, ##__VA_ARGS__); \
fputc('\n', stderr); \
exit(EXIT_FAILURE); \
}
#define dieusage(__msg, ...) \
{ \
fputs(PROGRAM_NAME ": ", stderr); \
fprintf(stderr, __msg, __VA_ARGS__); \
fputs("\n\n", stderr); \
showusage(stderr); \
exit(EXIT_FAILURE); \
}
#define dieiferr(__cond, __resT) \
{ \
__resT __res = __cond; \
if (__res.code != 0) { \
fprintf(stderr, "%s\n", __res.msg); \
exit(EXIT_FAILURE); \
} \
}
#endif // NITROROM_H