Skip to content

Commit

Permalink
minizip: Fix compatibility with Gentoo's unique zlib API
Browse files Browse the repository at this point in the history
Fixes godotengine#10539 in a diplomatic way (as opposed to telling Gentoo users
to just change their distro or rebuild zlib from upstream...).
  • Loading branch information
akien-mga committed Aug 22, 2017
1 parent 294e912 commit 67e6c1b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
27 changes: 27 additions & 0 deletions thirdparty/minizip/godot-zlib-1.2.4-minizip-unbreak-gentoo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/thirdparty/minizip/ioapi.h b/thirdparty/minizip/ioapi.h
index f25ab6464..6043d34ce 100644
--- a/thirdparty/minizip/ioapi.h
+++ b/thirdparty/minizip/ioapi.h
@@ -44,6 +44,22 @@
#include <stdlib.h>
#include "zlib.h"

+/* GODOT start */
+/* Mighty Gentoo saves the day by breaking the API of their zlib.h,
+ * removing this definition of OF(args) for no practical reason
+ * worth breaking compatibility with all projects that embed minizip
+ * while trying not to diverge too much from upstream zlib.
+ * Cf. https://github.com/godotengine/godot/issues/10539
+ *
+ * "By and large, this is good open source behaviour, and fits with
+ * the gentoo _don't fuck with upstream's releases_ philosophy"
+ * -- Gentoo philosopher
+ */
+#ifndef OF /* function prototypes */
+ #define OF(args) args
+#endif
+/* GODOT end */
+
#if defined(USE_FILE32API)
#define fopen64 fopen
#define ftello64 ftell
16 changes: 16 additions & 0 deletions thirdparty/minizip/ioapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@
#include <stdlib.h>
#include "zlib.h"

/* GODOT start */
/* Mighty Gentoo saves the day by breaking the API of their zlib.h,
* removing this definition of OF(args) for no practical reason
* worth breaking compatibility with all projects that embed minizip
* while trying not to diverge too much from upstream zlib.
* Cf. https://github.com/godotengine/godot/issues/10539
*
* "By and large, this is good open source behaviour, and fits with
* the gentoo _don't fuck with upstream's releases_ philosophy"
* -- Gentoo philosopher
*/
#ifndef OF /* function prototypes */
#define OF(args) args
#endif
/* GODOT end */

#if defined(USE_FILE32API)
#define fopen64 fopen
#define ftello64 ftell
Expand Down

0 comments on commit 67e6c1b

Please sign in to comment.