From 8bbe893319de261869253642052345df88dd3932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 22 Aug 2017 20:00:19 +0200 Subject: [PATCH] minizip: Fix compatibility with Gentoo's unique zlib API Fixes #10539 in a diplomatic way (as opposed to telling Gentoo users to just change their distro or rebuild zlib from upstream...). (cherry picked from commit 67e6c1b735d86e5c5a1bdd7aa9cd2852d3ee385f) --- ...ot-zlib-1.2.4-minizip-unbreak-gentoo.patch | 27 +++++++++++++++++++ thirdparty/minizip/ioapi.h | 16 +++++++++++ 2 files changed, 43 insertions(+) create mode 100644 thirdparty/minizip/godot-zlib-1.2.4-minizip-unbreak-gentoo.patch diff --git a/thirdparty/minizip/godot-zlib-1.2.4-minizip-unbreak-gentoo.patch b/thirdparty/minizip/godot-zlib-1.2.4-minizip-unbreak-gentoo.patch new file mode 100644 index 00000000000..9292e32ac6f --- /dev/null +++ b/thirdparty/minizip/godot-zlib-1.2.4-minizip-unbreak-gentoo.patch @@ -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 + #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 diff --git a/thirdparty/minizip/ioapi.h b/thirdparty/minizip/ioapi.h index f25ab6464f2..6043d34ceac 100644 --- a/thirdparty/minizip/ioapi.h +++ b/thirdparty/minizip/ioapi.h @@ -44,6 +44,22 @@ #include #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