From 2fc4023e0b1990b81e0e9bca0917ae6be3b6f6bc Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Sat, 24 Oct 2009 14:19:39 +0000
Subject: [PATCH] fix zlib includes

---
 Makefile             |  3 +++
 code/qcommon/unzip.c |  1 -
 code/qcommon/unzip.h | 13 ++++---------
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index d5fc8f7f..32373e54 100644
--- a/Makefile
+++ b/Makefile
@@ -879,6 +879,9 @@ endif
 
 ifeq ($(USE_INTERNAL_ZLIB),1)
   BASE_CFLAGS += -DNO_GZIP
+  ifneq ($(USE_LOCAL_HEADERS),1)
+    BASE_CFLAGS += -I$(ZDIR)
+  endif
 else
   LIBS += -lz
 endif
diff --git a/code/qcommon/unzip.c b/code/qcommon/unzip.c
index a50e186e..d0b3d2a5 100644
--- a/code/qcommon/unzip.c
+++ b/code/qcommon/unzip.c
@@ -38,7 +38,6 @@ woven in by Terry Thorsen 1/2003.
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "zlib.h"
 #include "unzip.h"
 
 #ifdef STDC
diff --git a/code/qcommon/unzip.h b/code/qcommon/unzip.h
index bac86952..b4a839b3 100644
--- a/code/qcommon/unzip.h
+++ b/code/qcommon/unzip.h
@@ -49,17 +49,12 @@
 extern "C" {
 #endif
 
-#ifndef _ZLIB_H
-  #ifdef USE_LOCAL_HEADERS
-    #include "../zlib/zlib.h"
-  #else
-    #include <zlib.h>
-  #endif
+#ifdef USE_LOCAL_HEADERS
+  #include "../zlib/zlib.h"
+#else
+  #include <zlib.h>
 #endif
-
-#ifndef _ZLIBIOAPI_H
 #include "ioapi.h"
-#endif
 
 #define NOUNCRYPT