You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
317 B
21 lines
317 B
#ifndef GAFU_ERR_H |
|
#define GAFU_ERR_H |
|
|
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
|
|
#define ERR(...) \ |
|
do { \ |
|
fprintf(stderr, "error: " __VA_ARGS__); \ |
|
fprintf(stderr, "\n"); \ |
|
exit(EXIT_FAILURE); \ |
|
} while (0) |
|
|
|
#define TRY(cond, ...) \ |
|
do { \ |
|
if (!(cond)) { \ |
|
ERR(__VA_ARGS__); \ |
|
} \ |
|
} while (0) |
|
|
|
#endif
|
|
|