Permalink
Browse files

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 #3133
Closes
  • Loading branch information...
MarcelRaad committed Jan 11, 2019
1 parent 61faa0b commit 04db3e2faaca0b356ba2217338999e2851aec6c9
Showing with 3 additions and 1 deletion.
  1. +3 −1 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


0 comments on commit 04db3e2

Please sign in to comment.