From 9c83000422b6ead66147fa12ce0de7650d0ea269 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 31 Dec 2004 02:57:08 +0000 Subject: [PATCH] Fixed compiler warning when using newer versions of libzip. --- ext/zip/config.m4 | 4 ++++ ext/zip/php_zip.h | 4 ++++ ext/zip/zip.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 8c66d6f5d0..63bfce79ba 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -20,6 +20,10 @@ if test "$PHP_ZIP" != "no"; then AC_MSG_ERROR(Cannot find libzzip) fi + if test -f $ZZIPLIB_INCDIR/zzip/zzip.h; then + AC_DEFINE(HAVE_NEW_ZZIPLIB,1,[ ]) + fi + ZZIPLIB_LIBDIR=$ZZIPLIB_DIR/lib PHP_CHECK_LIBRARY(zzip, zzip_open, diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 62f170d7f2..e8150c9dd1 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -21,7 +21,11 @@ #if HAVE_ZZIPLIB +#ifdef HAVE_NEW_ZZIPLIB +#include +#else #include +#endif extern zend_module_entry zip_module_entry; #define phpext_zip_ptr &zip_module_entry diff --git a/ext/zip/zip.c b/ext/zip/zip.c index 0ff681f2aa..6f2452f6b8 100644 --- a/ext/zip/zip.c +++ b/ext/zip/zip.c @@ -29,7 +29,12 @@ #if HAVE_ZZIPLIB #include "ext/standard/info.h" + +#ifdef HAVE_NEW_ZZIPLIB +#include +#else #include +#endif #ifndef O_BINARY #define O_BINARY 0 -- 2.40.0