aboutsummaryrefslogtreecommitdiff
path: root/winbuild
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-01-11 13:06:37 +0100
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-01-14 10:14:06 +0100
commit07367e717a1e8205240ad795b3b51c78b9f9d98d (patch)
treeaaefa73109457857c4fdb686cfdd44a60c614d6a /winbuild
parentd8852d0868c06cc29c208e743e5b1991ab2dba2b (diff)
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
Diffstat (limited to 'winbuild')
-rw-r--r--winbuild/MakefileBuild.vc4
1 files changed, 3 insertions, 1 deletions
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