From: George Tasker <gtasker@allenbrook.com>
Date: Thu, 4 Oct 2001 16:29:05 +0000 (+0000)
Subject: Changed code in unzip.c/.h for #including zlib.h to use the same code as is found... 
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ac2834ab04e6ca828e032b6168aa2e32134b7d8c

Changed code in unzip.c/.h for #including zlib.h to use the same code as is found in zstream.cpp
#include <zlib.h> changed to #include "zlib.h"


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/unzip.c b/src/common/unzip.c
index 551b1c6b2d..7b1369e5aa 100644
--- a/src/common/unzip.c
+++ b/src/common/unzip.c
@@ -21,7 +21,19 @@ $Id$
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "zlib.h"
+//#include "zlib.h"
+// normally, the compiler options should contain -I../zlib, but it is
+// apparently not the case for all MSW makefiles and so, unless we use
+// configure (which defines __WX_SETUP_H__) or it is explicitly overridden by
+// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
+#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
+   #include "../zlib/zlib.h"
+#elif defined(__WXMAC__) && defined(__UNIX__)
+   #include <Kernel/net/zlib.h>
+#else
+   #include "zlib.h"
+#endif
+
 
 /* Not the right solution (paths in makefiles) but... */
 #ifdef __BORLANDC__
diff --git a/src/common/unzip.h b/src/common/unzip.h
index 494beebfc4..024e3d9cd6 100644
--- a/src/common/unzip.h
+++ b/src/common/unzip.h
@@ -53,7 +53,18 @@ extern "C" {
 #endif
 
 #ifndef _ZLIB_H
-#include "zlib.h"
+//#include "zlib.h"
+// normally, the compiler options should contain -I../zlib, but it is
+// apparently not the case for all MSW makefiles and so, unless we use
+// configure (which defines __WX_SETUP_H__) or it is explicitly overridden by
+// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
+#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
+   #include "../zlib/zlib.h"
+#elif defined(__WXMAC__) && defined(__UNIX__)
+   #include <Kernel/net/zlib.h>
+#else
+   #include "zlib.h"
+#endif
 #endif
 
 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp
index 5142f077b6..2cfec91082 100644
--- a/src/common/zstream.cpp
+++ b/src/common/zstream.cpp
@@ -36,7 +36,7 @@
 #elif defined(__WXMAC__) && defined(__UNIX__)
    #include <Kernel/net/zlib.h>
 #else
-   #include <zlib.h>
+   #include "zlib.h"
 #endif
 
 #define ZSTREAM_BUFFER_SIZE 1024