From 3134c70f6859316af606d7d37754423280d2aedd Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 8 Jun 2024 20:03:10 +0200 Subject: [PATCH] Do not test WIN32, instead test _WIN32 To the best of my knowledge: * `_WIN32` and `_WIN64` are defined by the compiler, * `WIN32` and `WIN64` are defined by the user, to indicate whatever the user chooses them to indicate. They mean 32-bit and 64-bit Windows compilation by convention only. See: https://accu.org/journals/overload/24/132/wilson_2223/ Windows compilers in general, and MSVC in particular, have been defining `_WIN32` and `_WIN64` for a long time, provably at least since Visual Studio 2015, and in practice as early as in the days of 16-bit Windows. See: https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-140 https://learn.microsoft.com/en-us/windows/win32/winprog64/the-tools Tests used to be inconsistent, usually testing `_WIN32` and here testing `WIN32`. This brings consistency to Windows detection. --- test/minigzip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/minigzip.c b/test/minigzip.c index 541f3716b..201d00519 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -40,7 +40,7 @@ # include #endif -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) +#if defined(MSDOS) || defined(OS2) || defined(_WIN32) || defined(__CYGWIN__) # include # include # ifdef UNDER_CE @@ -67,7 +67,7 @@ #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