diff options
Diffstat (limited to 'include/err.h')
-rw-r--r-- | include/err.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/include/err.h b/include/err.h deleted file mode 100644 index ec90327..0000000 --- a/include/err.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * Public domain | ||
3 | * err.h compatibility shim | ||
4 | */ | ||
5 | |||
6 | #ifdef HAVE_ERR_H | ||
7 | |||
8 | #include_next <err.h> | ||
9 | |||
10 | #else | ||
11 | |||
12 | #ifndef LIBCRYPTOCOMPAT_ERR_H | ||
13 | #define LIBCRYPTOCOMPAT_ERR_H | ||
14 | |||
15 | #include <errno.h> | ||
16 | #include <stdio.h> | ||
17 | #include <string.h> | ||
18 | |||
19 | #define err(exitcode, format, args...) \ | ||
20 | errx(exitcode, format ": %s", ## args, strerror(errno)) | ||
21 | |||
22 | #define errx(exitcode, format, args...) \ | ||
23 | do { warnx(format, ## args); exit(exitcode); } while (0) | ||
24 | |||
25 | #define warn(format, args...) \ | ||
26 | warnx(format ": %s", ## args, strerror(errno)) | ||
27 | |||
28 | #define warnx(format, args...) \ | ||
29 | fprintf(stderr, format "\n", ## args) | ||
30 | |||
31 | #endif | ||
32 | |||
33 | #endif | ||