summaryrefslogtreecommitdiffstats
path: root/tests/ptyx.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-07-07 13:53:04 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-07-26 14:19:52 -0400
commit1bae72d2b5bbbf7d71b1ff9a1f88fbe560d9b7ba (patch)
tree00a4841a85d59a02befc8f139c49f82fe3ac6907 /tests/ptyx.c
parentb4e3696101b049815dac8459b2b9cb18213b489e (diff)
downloadbfs-1bae72d2b5bbbf7d71b1ff9a1f88fbe560d9b7ba.tar.xz
Simplify some more macros with C23 syntaxHEADmain
Diffstat (limited to 'tests/ptyx.c')
-rw-r--r--tests/ptyx.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/ptyx.c b/tests/ptyx.c
index 59292df..bd47699 100644
--- a/tests/ptyx.c
+++ b/tests/ptyx.c
@@ -48,20 +48,16 @@ int main(int argc, char *argv[]) {
const char *cmd = argc > 0 ? argv[0] : "ptyx";
/** Report an error message and exit. */
-#define die(...) die_(__VA_ARGS__, )
-
-#define die_(format, ...) \
+#define die(format, ...) \
do { \
- fprintf(stderr, "%s: " format "%s", cmd, __VA_ARGS__ "\n"); \
+ fprintf(stderr, "%s: " format "\n", cmd __VA_OPT__(,) __VA_ARGS__); \
exit(EXIT_FAILURE); \
} while (0)
/** Report an error code and exit. */
-#define edie(...) edie_(__VA_ARGS__, )
-
-#define edie_(format, ...) \
+#define edie(format, ...) \
do { \
- fprintf(stderr, "%s: " format ": %s\n", cmd, __VA_ARGS__ errstr()); \
+ fprintf(stderr, "%s: " format ": %s\n", cmd __VA_OPT__(,) __VA_ARGS__, errstr()); \
exit(EXIT_FAILURE); \
} while (0)