From 778ed0360c8391abe0d2a9e96a33b346e65cb346 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Thu, 16 Jun 2022 16:06:01 +0800 Subject: [PATCH] common/minizip/*: fix OF prototypes Because the sys-libs/zlib header pollutes the macro namespace, leading to build failures. Under the gentoo operating system, the macro definition of OF becomes _Z_OF in zconf.h, but the recently introduced minizip has introduced a large number of OF, leading to build fail. Therefore, the prototypes of OF are added so that they can be successfully built under various operating systems. Bug: https://bugs.gentoo.org/383179 Signed-off-by: Huang Rui --- common/minizip/ioapi.h | 1 + common/minizip/mztools.h | 1 + common/minizip/of.h | 12 ++++++++++++ common/minizip/unzip.h | 1 + common/minizip/zip.h | 1 + 5 files changed, 16 insertions(+) create mode 100644 common/minizip/of.h diff --git a/common/minizip/ioapi.h b/common/minizip/ioapi.h index 8dcbdb06..168ea532 100644 --- a/common/minizip/ioapi.h +++ b/common/minizip/ioapi.h @@ -44,6 +44,7 @@ #include #include #include "zlib.h" +#include "of.h" #if defined(USE_FILE32API) #define fopen64 fopen diff --git a/common/minizip/mztools.h b/common/minizip/mztools.h index a49a426e..732b86b6 100644 --- a/common/minizip/mztools.h +++ b/common/minizip/mztools.h @@ -13,6 +13,7 @@ extern "C" { #ifndef _ZLIB_H #include "zlib.h" +#include "of.h" #endif #include "unzip.h" diff --git a/common/minizip/of.h b/common/minizip/of.h new file mode 100644 index 00000000..ca058ffe --- /dev/null +++ b/common/minizip/of.h @@ -0,0 +1,12 @@ +#ifndef _OF_H +#define _OF_H + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#endif /* _OF_H */ diff --git a/common/minizip/unzip.h b/common/minizip/unzip.h index 2104e391..01978472 100644 --- a/common/minizip/unzip.h +++ b/common/minizip/unzip.h @@ -49,6 +49,7 @@ extern "C" { #ifndef _ZLIB_H #include "zlib.h" +#include "of.h" #endif #ifndef _ZLIBIOAPI_H diff --git a/common/minizip/zip.h b/common/minizip/zip.h index 8aaebb62..a51f3dbd 100644 --- a/common/minizip/zip.h +++ b/common/minizip/zip.h @@ -48,6 +48,7 @@ extern "C" { #ifndef _ZLIB_H #include "zlib.h" +#include "of.h" #endif #ifndef _ZLIBIOAPI_H