From 07367e717a1e8205240ad795b3b51c78b9f9d98d Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Fri, 11 Jan 2019 13:06:37 +0100 Subject: winbuild: conditionally use /DZLIB_WINAPI 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 5cda3900f..3125c21b8 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -239,6 +239,7 @@ ZLIB_LIB_DIR = $(DEVEL_LIB) !IF "$(WITH_ZLIB)"=="dll" !IF EXISTS("$(ZLIB_LIB_DIR)\zlibwapi.lib") ZLIB_LIBS = zlibwapi.lib +ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib") ZLIB_LIBS = zdll.lib !ELSE @@ -249,6 +250,7 @@ ZLIB = dll !ELSEIF "$(WITH_ZLIB)"=="static" !IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib") ZLIB_LIBS = zlibstat.lib +ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib") ZLIB_LIBS = zlib.lib !ELSE @@ -259,7 +261,7 @@ ZLIB = static !ENDIF !IFDEF USE_ZLIB -ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I"$(ZLIB_INC_DIR)" +ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ $(ADDITIONAL_ZLIB_CFLAGS) /I"$(ZLIB_INC_DIR)" !ENDIF -- cgit v1.2.3