From: molivier Date: Sun, 11 Sep 2005 07:30:26 +0000 (+0000) Subject: - Updated Zlib definitions to version 1.2.3. The only difference is that X-Git-Tag: xonotic-v0.1.0preview~4565 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f15c5ba64dba456f8768b0e02165acf2c4083414;p=xonotic%2Fdarkplaces.git - Updated Zlib definitions to version 1.2.3. The only difference is that the function calling convention has changed on Win32 (previously, the zlib DLL used WINAPI). YOU NOW NEED AN OFFICIAL "zlib1.dll" version 1.2.x instead of your old "zlib.dll" (get it from http://www.zlib.net/). If you still want to use a DLL with the old calling convention, uncomment line 101 and recompile (such a DLL can be found at http://www.winimage.com/zLibDll/). - Removed QuakeForge copyright since the last bit of QF code was removed months ago by LordHavoc - Changed the way we test the presence of the O_NONBLOCK flag git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5716 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/fs.c b/fs.c index 149415d3..1ff670a0 100644 --- a/fs.c +++ b/fs.c @@ -2,7 +2,6 @@ DarkPlaces file system Copyright (C) 2003-2005 Mathieu Olivier - Copyright (C) 1999,2000 contributors of the QuakeForge project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -44,6 +43,11 @@ # define O_BINARY 0 #endif +// In case the system doesn't support the O_NONBLOCK flag +#ifndef O_NONBLOCK +# define O_NONBLOCK 0 +#endif + /* @@ -90,7 +94,11 @@ CONSTANTS #define MAX_WBITS 15 #define Z_OK 0 #define Z_STREAM_END 1 -#define ZLIB_VERSION "1.1.4" +#define ZLIB_VERSION "1.2.3" + +// Uncomment the following line if the zlib DLL you have still uses +// the 1.1.x series calling convention on Win32 (WINAPI) +//#define ZLIB_USES_WINAPI /* @@ -281,7 +289,7 @@ PRIVATE FUNCTIONS - PK3 HANDLING */ // Functions exported from zlib -#ifdef WIN32 +#if defined(WIN32) && defined(ZLIB_USES_WINAPI) # define ZEXPORT WINAPI #else # define ZEXPORT @@ -335,7 +343,12 @@ qboolean PK3_OpenLibrary (void) #if defined(WIN64) "zlib64.dll", #elif defined(WIN32) +# ifdef ZLIB_USES_WINAPI + "zlibwapi.dll", "zlib.dll", +# else + "zlib1.dll", +# endif #elif defined(MACOSX) "libz.dylib", #else @@ -1115,10 +1128,8 @@ static qfile_t* FS_SysOpen (const char* filepath, const char* mode, qboolean non } } -#ifndef WIN32 if (nonblocking) opt |= O_NONBLOCK; -#endif file = Mem_Alloc (fs_mempool, sizeof (*file)); memset (file, 0, sizeof (*file));