summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2021-06-01 18:21:08 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-06-01 18:21:08 +0200
commit55ac2338fcf5c3f2f3f812fd53063ce58aa38a49 (patch)
tree034020ab2e64a27b98a7bb87296fd24675ddf9d2 /util.h
parentcbb82666e00815aa2dbcc3f144460f3003b46b70 (diff)
portability and standards: add BSD-like err() and errx() functions
These are BSD functions. - HaikuOS now compiles without having to use libbsd. - Tested on SerenityOS (for fun), which doesn't have these functions (yet). With a small change to support wcwidth() sfeed works on SerenityOS.
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.h b/util.h
index 15d6702..1570d67 100644
--- a/util.h
+++ b/util.h
@@ -38,6 +38,14 @@ enum {
FieldLast
};
+/* hint for compilers and static analyzers that a function exits */
+#ifndef __dead
+#define __dead
+#endif
+
+__dead void err(int, const char *, ...);
+__dead void errx(int, const char *, ...);
+
int uri_format(char *, size_t, struct uri *);
int uri_hasscheme(const char *);
int uri_makeabs(struct uri *, struct uri *, struct uri *);