summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2018-03-22 11:01:18 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2018-03-22 10:01:18 +0100
commitec6adfbfb0e482707b194de916f9325e64d2137d (patch)
tree9b4bc4a4933b851232327e5d9b40683d43a70840 /win32
parent6f2fdf7b755f06bfe3d81c33fcfb9d5f12bad0da (diff)
[MSVC] Fix size_t/ssize_t when using ZLIB_COMPAT. (#161)
* zconf.h.in wasn't including Windows.h, that is correct header to include definitions from BaseTsd.h, and such missing required type definition for ssize_t when compiling using MS Visual C++ * Various places need implicit casting to z_size_t to get around compatibility issues, this will truncate the result when ZLIB_COMPAT is defined, calling code should check for truncation. * Add ZLIB_COMPAT flag to nmake Makefile and use it to determine correct filenames instead of WITH_GZFILEOP
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.msc12
1 files changed, 9 insertions, 3 deletions
diff --git a/win32/Makefile.msc b/win32/Makefile.msc
index 38c3720..08ee855 100644
--- a/win32/Makefile.msc
+++ b/win32/Makefile.msc
@@ -31,14 +31,15 @@ DEFFILE = zlib.def
RCFILE = zlib1.rc
RESFILE = zlib1.res
WITH_GZFILEOP =
+ZLIB_COMPAT =
SUFFIX =
OBJS = adler32.obj compress.obj crc32.obj deflate.obj deflate_fast.obj deflate_quick.obj deflate_slow.obj \
functable.obj infback.obj inflate.obj inftrees.obj inffast.obj match.obj trees.obj uncompr.obj zutil.obj \
x86.obj fill_window_sse.obj insert_string_sse.obj crc_folding.obj crc_pclmulqdq.obj
-!if "$(WITH_GZFILEOP)" != ""
-WFLAGS = $(WFLAGS) -DWITH_GZFILEOP
-OBJS = $(OBJS) gzclose.obj gzlib.obj gzread.obj gzwrite.obj
+!if "$(ZLIB_COMPAT)" != ""
+WITH_GZFILEOP = yes
+WFLAGS = $(WFLAGS) -DZLIB_COMPAT
DEFFILE = zlibcompat.def
!else
STATICLIB = zlib-ng.lib
@@ -50,6 +51,11 @@ RESFILE = zlib-ng1.res
SUFFIX = -ng
!endif
+!if "$(WITH_GZFILEOP)" != ""
+WFLAGS = $(WFLAGS) -DWITH_GZFILEOP
+OBJS = $(OBJS) gzclose.obj gzlib.obj gzread.obj gzwrite.obj
+!endif
+
# targets
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
example.exe minigzip.exe example_d.exe minigzip_d.exe