diff options
| author | Tom Harley | 2023-02-01 19:52:58 +0000 |
|---|---|---|
| committer | Tom Harley | 2023-02-01 20:56:29 +0000 |
| commit | 98154521de3a832a4297f05f2bb8d1c01b7641fb (patch) | |
| tree | 5e54c7fc4cccd86ad471fc8178ff870be7666bae /error.h | |
| parent | Upgrade to LLVM 14 (diff) | |
| download | sinter-98154521de3a832a4297f05f2bb8d1c01b7641fb.tar.gz sinter-98154521de3a832a4297f05f2bb8d1c01b7641fb.zip | |
Add warn macro
Makes it possible to print to stderr in non-debug mode, for example to warn the user of a possible error.
Diffstat (limited to 'error.h')
| -rw-r--r-- | error.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -20,4 +20,12 @@ enum errcode { exit(v); \ } while (0) +#define _warn(fmt, ...) do { \ + fprintf(stderr, fmt "\n", __VA_ARGS__); \ +} while (0) + +#define warn(...) do { \ + _warn(__VA_ARGS__); \ +} while (0) + #endif /* ERROR_H */ |
