# include "zlib-ng.h"
#endif
-#ifdef WIN32
+#ifdef _WIN32
# include <stddef.h>
#endif
# include <unistd.h> /* for lseek(), read(), close(), write(), unlink() */
#endif
-#if defined(_MSC_VER) || defined(WIN32)
+#if defined(_WIN32)
# include <io.h>
-#endif
-
-#if defined(_WIN32) || defined(__MINGW__)
# define WIDECHAR
#endif
#endif
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-#if !defined(STDC99) && !defined(__CYGWIN__) && !defined(__MINGW__) && defined(WIN32)
+#if !defined(STDC99) && !defined(__CYGWIN__) && !defined(__MINGW__) && defined(_WIN32)
# if !defined(vsnprintf)
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
# define vsnprintf _vsnprintf
#include "zbuild.h"
#include "gzguts.h"
-#if defined(WIN32) && !defined(__BORLANDC__)
+#if defined(_WIN32) && !defined(__BORLANDC__)
# define LSEEK _lseeki64
#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
/* open the file with the appropriate flags (or just use fd) */
state->fd = fd > -1 ? fd : (
-#if defined(WIN32) || defined(__MINGW__)
+#if defined(_WIN32)
fd == -2 ? _wopen(path, oflag, 0666) :
#elif __CYGWIN__
fd == -2 ? open(state->path, oflag, 0666) :
# include <malloc.h>
#endif
-#if defined(WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#endif
#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
-#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+#ifndef _WIN32 /* unlink already in stdio.h for Win32 */
extern int unlink (const char *);
#endif
#endif
# include <malloc.h>
#endif
-#if defined(WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#endif
#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
-#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+#ifndef _WIN32 /* unlink already in stdio.h for Win32 */
extern int unlink (const char *);
#endif
#endif
#ifndef ZCONFNG_H
#define ZCONFNG_H
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
+#if !defined(_WIN32) && defined(__WIN32__)
+# define _WIN32
#endif
#ifdef __STDC_VERSION__
for small objects.
*/
- /* Type declarations */
+/* Type declarations */
-#if defined(WINDOWS) || defined(WIN32)
+#if defined(_WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
+# if defined(ZLIB_DLL) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
# define z_off_t long
#endif
-#if !defined(WIN32) && defined(Z_LARGE64)
+#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(__MSYS__)
# define z_off64_t _off64_t
-# elif defined(WIN32) && !defined(__GNUC__)
+# elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
#ifndef ZCONF_H
#define ZCONF_H
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
+#if !defined(_WIN32) && defined(__WIN32__)
+# define _WIN32
#endif
#ifdef __STDC_VERSION__
for small objects.
*/
- /* Type declarations */
+/* Type declarations */
#ifndef OF /* function prototypes */
# define OF(args) args
#endif
-#if defined(WINDOWS) || defined(WIN32)
+#if defined(_WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
+# if defined(ZLIB_DLL) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
# define z_off_t long
#endif
-#if !defined(WIN32) && defined(Z_LARGE64)
+#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(__MSYS__)
# define z_off64_t _off64_t
-# elif defined(WIN32) && !defined(__GNUC__)
+# elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
#elif defined(__MINGW32__)
# include <sys/param.h>
-#elif defined(WIN32) || defined(_WIN32)
+#elif defined(_WIN32)
# define LITTLE_ENDIAN 1234
# define BIG_ENDIAN 4321
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64) || defined (_M_ARM) || defined (_M_ARM64)
ZEXTERN ZEXPORT int zng_deflateResetKeep (zng_stream *);
#ifdef WITH_GZFILEOP
-# if (defined(WIN32) || defined(__MINGW__))
+# if defined(_WIN32)
ZEXTERN ZEXPORT gzFile zng_gzopen_w(const wchar_t *path, const char *mode);
# endif
ZEXTERN ZEXPORTVA int zng_gzvprintf(gzFile file, const char *format, va_list va);
ZEXTERN int ZEXPORT inflateResetKeep (z_stream *);
ZEXTERN int ZEXPORT deflateResetKeep (z_stream *);
-#if (defined(WIN32) || defined(__MINGW__))
+#if defined(_WIN32)
ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode);
#endif
ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va);
# define OS_CODE 13
#endif
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__)
# define OS_CODE 10
#endif
#endif
/* provide prototypes for these when building zlib without LFS */
-#if !defined(WIN32) && !defined(__MSYS__) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+#if !defined(_WIN32) && !defined(__MSYS__) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
# include "zbuild.h" /* For PREFIX() */
ZEXTERN uint32_t ZEXPORT PREFIX(adler32_combine64)(uint32_t, uint32_t, z_off_t);
ZEXTERN uint32_t ZEXPORT PREFIX(crc32_combine64)(uint32_t, uint32_t, z_off_t);
/* Reverse the bytes in a value. Use compiler intrinsics when
possible to take advantage of hardware implementations. */
-#if defined(WIN32) && (_MSC_VER >= 1300)
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
# pragma intrinsic(_byteswap_ulong)
# define ZSWAP16(q) _byteswap_ushort(q)
# define ZSWAP32(q) _byteswap_ulong(q)