diff options
-rw-r--r-- | Makefile.nmake | 12 | ||||
-rw-r--r-- | config.nmake | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl-utils.c | 4 | ||||
-rw-r--r-- | wiretap/file_wrappers.h | 6 |
4 files changed, 18 insertions, 6 deletions
diff --git a/Makefile.nmake b/Makefile.nmake index 1a993d341b..a87668233b 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -124,7 +124,7 @@ RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \ LIBS_CHECK=_libs_check_ -all: $(LIBS_CHECK) config.h tools image codecs $(ZLIB_DIR)\zlib1.dll wiretap epan $(EXECUTABLES) $(RESOURCES) doc install-deps +all: $(LIBS_CHECK) config.h tools image codecs $(ZLIB_DLL) wiretap epan $(EXECUTABLES) $(RESOURCES) doc install-deps packaging: all cd packaging @@ -192,7 +192,7 @@ packaging_zip: packaging_zip1 packaging_zip2 $(RESOURCES): image -wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DIR)\zlib1.dll wiretap +wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap !IFNDEF GTK1_DIR wireshark.exe : @@ -417,9 +417,11 @@ clean: clean-local # "distclean" removes all files not part of the distribution. # It does not remove generated files that are part of the distribution. distclean-local: clean-local +!IFDEF ZLIB_DIR rm -f $(ZLIB_DIR)\zlib1.dll $(ZLIB_DIR)\zlib1.dll.manifest \ $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \ $(ZLIB_DIR)\lib\zdll.lib +!ENDIF rm -f config.h $(BUILT_SOURCES) distclean: distclean-local @@ -492,11 +494,12 @@ image:: $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake cd .. +!IFDEF ZLIB_DIR # None MSVC6 variants have to avoid indirectly using msvcrt.dll, # therefore compile the zlib dll from source ZLIB_DIR package. # To avoid path problems, copy the zlib sources to a temp dir, # compile and copy the resulting files back to (source) ZLIB_DIR -$(ZLIB_DIR)\zlib1.dll: +$(ZLIB_DLL): xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y cd zlib.tmp $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" @@ -512,6 +515,7 @@ $(ZLIB_DIR)\zlib1.dll: copy zlib.h $(ZLIB_DIR)\include cd .. rm -r -f zlib.tmp +!ENDIF wiretap:: cd wiretap @@ -540,7 +544,7 @@ gtk2:: help config.h svnversion.h AUTHORS-SHORT $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib cd .. -epan:: $(RESOURCES) $(ZLIB_DIR)\zlib1.dll wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen +epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen cd epan $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake cd .. diff --git a/config.nmake b/config.nmake index fe02e279b4..2859f15ade 100644 --- a/config.nmake +++ b/config.nmake @@ -681,11 +681,13 @@ WPCAP_CONSTIFIED= ZLIB_PATH=$(ZLIB_DIR) ZLIB_CFLAGS=/I$(ZLIB_DIR)\include ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib +ZLIB_DLL=$(ZLIB_DIR)\zlib1.dll # Nmake uses carets to escape special characters ZLIB_CONFIG=^#define HAVE_LIBZ 1 !else ZLIB_CFLAGS= ZLIB_LIBS= +ZLIB_DLL= ZLIB_CONFIG= !ENDIF diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index 68057e9dd0..010370a4df 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -1186,7 +1186,9 @@ static SslDecompress* ssl_create_decompressor(gint compression) { SslDecompress *decomp; +#ifdef HAVE_LIBZ int err; +#endif if (compression == 0) return NULL; ssl_debug_printf("ssl_create_decompressor: compression method %d\n", compression); @@ -1686,7 +1688,9 @@ dtls_check_mac(SslDecoder*decoder, gint ct,int ver, guint8* data, int ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, StringInfo* out_str, guint* outl) { +#ifdef HAVE_LIBZ gint err; +#endif switch (decomp->compression) { #ifdef HAVE_LIBZ diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h index 22d4a24b8c..b990a0014a 100644 --- a/wiretap/file_wrappers.h +++ b/wiretap/file_wrappers.h @@ -32,6 +32,7 @@ extern int file_error(void *fh); extern FILE_T file_open(const char *path, const char *mode); #define filed_open gzdopen +/* XX: gzread and gzwrite return number of *bytes* (not number of elements) */ #define file_read(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize))) #define file_write(buf, bsize, count, file) gzwrite((file),(buf),((count)*(bsize))) #define file_close gzclose @@ -43,8 +44,9 @@ extern FILE_T file_open(const char *path, const char *mode); #define file_open(path, mode) eth_fopen(path, mode) #define filed_open fdopen -#define file_read fread -#define file_write fwrite +/* XX: file_read and file_write defined to return number of *bytes* to be consistent with gzread & gzwrite */ +#define file_read(buf, bsize, count, file) ((bsize) * fread((buf), (bsize), (count), (file))) +#define file_write(buf, bsize, count, file) ((bsize) * fwrite((buf), (bsize), (count), (file))) #define file_close fclose #define file_getc fgetc #define file_gets fgets |