Consistency
[llpp.git] / cutils.h
blob94c454f82e9bebad3e102171654290dd6cf79040
1 #ifndef CUTILS_H
2 #define CUTILS_H
4 #if defined __GNUC__
5 #define NORETURN_ATTR __attribute__ ((noreturn))
6 #define UNUSED_ATTR __attribute__ ((unused))
7 #if !defined __clang__
8 #define NO_OPTIMIZE_ATTR __attribute__ ((optimize ("O0")))
9 #else
10 #define NO_OPTIMIZE_ATTR __attribute__ ((optnone))
11 #endif
12 #define GCC_FMT_ATTR(a, b) __attribute__ ((format (printf, a, b)))
13 #else
14 #error No workee wiz dat cmapjler
15 #endif
17 extern void NORETURN_ATTR GCC_FMT_ATTR (2, 3)
18 err (int exitcode, const char *fmt, ...);
19 extern void NORETURN_ATTR GCC_FMT_ATTR (2, 3)
20 errx (int exitcode, const char *fmt, ...);
21 extern void *parse_pointer (const char *cap, const char *s);
22 extern double now (void);
23 extern void fmt_linkn (char *s, unsigned int u);
24 extern char *ystrdup (const char *s);
26 #endif