From 4726bfb50c95c3090e4c3bddf5981a4562f9f600 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jos=C3=A9=20Fonseca?= <jose.r.fonseca@gmail.com>
Date: Sat, 8 Oct 2011 17:30:27 +0100
Subject: [PATCH] Fix MSVC build.

---
 thirdparty/zlib/CMakeLists.txt | 9 +++++++--
 thirdparty/zlib/zconf.h        | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/thirdparty/zlib/CMakeLists.txt b/thirdparty/zlib/CMakeLists.txt
index 1721574..55423c8 100644
--- a/thirdparty/zlib/CMakeLists.txt
+++ b/thirdparty/zlib/CMakeLists.txt
@@ -1,6 +1,11 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (${CMAKE_CURRENT_SOURCE_DIR})
 
-add_definitions(-DNO_VIZ)
+add_definitions (-DNO_VIZ)
+
+# adjust warnings
+if (MSVC)
+    add_definitions (-wd4131) # uses old-style declarator
+endif ()
 
 add_library (z_bundled STATIC
     adler32.c
diff --git a/thirdparty/zlib/zconf.h b/thirdparty/zlib/zconf.h
index b234387..ced649e 100644
--- a/thirdparty/zlib/zconf.h
+++ b/thirdparty/zlib/zconf.h
@@ -356,7 +356,7 @@ typedef uLong FAR uLongf;
    typedef Byte       *voidp;
 #endif
 
-#if 1    /* was set to #if 1 by ./configure */
+#if !defined(_MSC_VER)
 #  define Z_HAVE_UNISTD_H
 #endif
 
-- 
2.45.2