Skip to content

Commit

Permalink
graphviz: patch for ghostscript>=9.16 (Homebrew#49)
Browse files Browse the repository at this point in the history
Ghostscript>=9.16 renames their error codes from the prefix `e_`
to `gs_error_`. This patch, based on
ellson/MOTHBALLED-graphviz@f97c86e,
checks if the `e_` prefixed codes have been defined and sets them
equal to their `gs_error_` variants if they exist.
  • Loading branch information
karanlyons authored and zmwangx committed Sep 11, 2016
1 parent 1fab5d9 commit 6a6a1a3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions graphviz/patch-gvloadimage_gs.c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/plugin/gs/gvloadimage_gs.c b/plugin/gs/gvloadimage_gs.c
index 62dd3c9..6d9ed3d 100644
--- a/plugin/gs/gvloadimage_gs.c
+++ b/plugin/gs/gvloadimage_gs.c
@@ -32,6 +32,21 @@
#include <ghostscript/ierrors.h>
#include <cairo/cairo.h>

+
+/** Ensure compatibility with Ghostscipt versions newer than 9.16 **/
+
+#ifndef e_VMerror
+#define e_VMerror gs_error_VMerror
+#endif
+
+#ifndef e_unregistered
+#define e_unregistered gs_error_unregistered
+#endif
+
+#ifndef e_invalidid
+#define e_invalidid gs_error_invalidid
+#endif
+
#ifdef WIN32
#define NUL_FILE "nul"
#else

0 comments on commit 6a6a1a3

Please sign in to comment.