From 1889c36dea2865b10fe5fcbc11d784e1c9255d23 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 27 Nov 2018 13:57:32 +0000 Subject: [PATCH] add HAVE_ZLIB around the rest of the zlib stuff in w_wad.c/h, move zlib.h inclusion down below doomdef.h etc includes in case that does anything for compiling (?) --- src/w_wad.c | 34 ++++++++++++++++++---------------- src/w_wad.h | 2 ++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 9c97c72f..8693dd40 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -26,22 +26,6 @@ #include "lzf.h" #endif -#ifndef _MSC_VER -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif -#endif - -#ifndef _LFS64_LARGEFILE -#define _LFS64_LARGEFILE -#endif - -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 0 -#endif - -#include "zlib.h" - #include "doomdef.h" #include "doomstat.h" #include "doomtype.h" @@ -79,6 +63,24 @@ int snprintf(char *str, size_t n, const char *fmt, ...); #define O_BINARY 0 #endif +#ifdef HAVE_ZLIB +#ifndef _MSC_VER +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE +#endif +#endif + +#ifndef _LFS64_LARGEFILE +#define _LFS64_LARGEFILE +#endif + +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 0 +#endif + +#include "zlib.h" +#endif + typedef struct { diff --git a/src/w_wad.h b/src/w_wad.h index 4a15b23b..8baf061a 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -154,7 +154,9 @@ size_t W_LumpLength(lumpnum_t lumpnum); boolean W_IsLumpWad(lumpnum_t lumpnum); // for loading maps from WADs in PK3s +#ifdef HAVE_ZLIB void zerr(int ret); // zlib error checking +#endif size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, size_t offset); size_t W_ReadLumpHeader(lumpnum_t lump, void *dest, size_t size, size_t offest); // read all or a part of a lump