]> granicus.if.org Git - curl/commitdiff
winbuild: conditionally use /DZLIB_WINAPI
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 11 Jan 2019 12:06:37 +0000 (13:06 +0100)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 14 Jan 2019 09:14:06 +0000 (10:14 +0100)
zlibwapi.lib (dynamic library) and zlibstat.lib (static library) have
the ZLIB_WINAPI define set by default. Using them requires that define
too.

Ref: https://zlib.net/DLL_FAQ.txt

Fixes https://github.com/curl/curl/issues/3133
Closes https://github.com/curl/curl/pull/3460

winbuild/MakefileBuild.vc

index 5cda3900f54acfef561ee5ddba878322e42b44a8..3125c21b8f2e3569f5d0eef9f0fcf7209b3ff339 100644 (file)
@@ -239,6 +239,7 @@ ZLIB_LIB_DIR = $(DEVEL_LIB)
 !IF "$(WITH_ZLIB)"=="dll"\r
 !IF EXISTS("$(ZLIB_LIB_DIR)\zlibwapi.lib")\r
 ZLIB_LIBS = zlibwapi.lib\r
+ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI\r
 !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib")\r
 ZLIB_LIBS   = zdll.lib\r
 !ELSE\r
@@ -249,6 +250,7 @@ ZLIB        = dll
 !ELSEIF "$(WITH_ZLIB)"=="static"\r
 !IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib")\r
 ZLIB_LIBS   = zlibstat.lib\r
+ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI\r
 !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib")\r
 ZLIB_LIBS   = zlib.lib\r
 !ELSE\r
@@ -259,7 +261,7 @@ ZLIB        = static
 !ENDIF\r
 \r
 !IFDEF USE_ZLIB\r
-ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I"$(ZLIB_INC_DIR)"\r
+ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ $(ADDITIONAL_ZLIB_CFLAGS) /I"$(ZLIB_INC_DIR)"\r
 !ENDIF\r
 \r
 \r