summaryrefslogtreecommitdiff
path: root/server/epdfinfo.h
diff options
context:
space:
mode:
authorIvan Andrus <darthandrus@gmail.com>2015-02-07 17:16:03 -0700
committerIvan Andrus <darthandrus@gmail.com>2015-02-07 17:18:07 -0700
commit904480093754ffcb5b08c57df19cd1509879f8a6 (patch)
tree4735ecefdb5fde959571453457444c362784b01d /server/epdfinfo.h
parenta0e9a67fc4e6f69580ab90cafa0a99a845d68f5e (diff)
Move error to header
Diffstat (limited to 'server/epdfinfo.h')
-rw-r--r--server/epdfinfo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/epdfinfo.h b/server/epdfinfo.h
index f812c41..a23fd60 100644
--- a/server/epdfinfo.h
+++ b/server/epdfinfo.h
@@ -99,6 +99,19 @@
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
+#ifdef __APPLE__
+# define error(status, errno, fmt, args...) \
+ do { \
+ int error = (errno); \
+ fflush (stdout); \
+ fprintf (stderr, "%s: " fmt, PACKAGE_NAME, ## args); \
+ if (error) \
+ fprintf (stderr, ": %s", strerror (error)); \
+ fprintf (stderr, "\n"); \
+ exit (status); \
+ } while (0)
+#endif
+
#define internal_error(fmt, args...) \
error (2, 0, "internal error in %s: " fmt, __func__, ## args)