mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-08-23 18:05:34 -05:00
Some checks failed
build / build (push) Has been cancelled
Co-authored-by: Rachel <rachel@lhea.me>
33 lines
1.1 KiB
C
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
|