summaryrefslogtreecommitdiff
path: root/src/util/replace.h
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-10-17 19:11:52 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2019-10-25 18:37:51 +0100
commit608640b87dc47233940664632e3ab8f13972be2b (patch)
tree221ff4d17dfb5805f8cebdbaee76a1e67641e0dd /src/util/replace.h
parent13ebb8f32f767c596b1b8bd16b90703a8135f20b (diff)
Fix Win32 build since c4ed2e06 "Add some unit testing utilities"
Provide Win32 replacements for realpath() and err.h
Diffstat (limited to 'src/util/replace.h')
-rw-r--r--src/util/replace.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/replace.h b/src/util/replace.h
index 1a24820..53a81a2 100644
--- a/src/util/replace.h
+++ b/src/util/replace.h
@@ -57,5 +57,21 @@ extern _X_HIDDEN size_t
strlcat(char *dst, const char *src, size_t siz);
#endif
+#ifndef HAVE_ERR_H
+#define err(eval, ...) do { \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n"); \
+ exit(eval); \
+ } while (0)
+#define vwarn(...) do { \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n"); \
+ } while (0)
+#endif
+
+#ifndef HAVE_REALPATH
+extern _X_HIDDEN char *
+realpath(const char *path, char *resolved_path);
+#endif
#endif /* XFONT_REPLACE_H */