From ecb47d451281b4f2b116c0eda8913e61ba508120 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 Oct 2021 09:37:32 +0200 Subject: [PATCH] mapserver.h: check _WIN32 instead of WIN32 The canonical macro is _WIN32. WIN32 usually exists as well, but is a non-standard macro. See https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-160 --- mapregex.h | 2 +- mapscript/mapscript.i | 2 +- mapserv.c | 8 ++++---- mapserver.h | 4 ++-- mapwms.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mapregex.h b/mapregex.h index 166c8d4fd8..77a358f0c1 100644 --- a/mapregex.h +++ b/mapregex.h @@ -36,7 +36,7 @@ extern "C" { /* We want these to match the POSIX standard, so we need these*/ /* === regex2.h === */ -#ifdef WIN32 +#ifdef _WIN32 #define MS_API_EXPORT(type) __declspec(dllexport) type __stdcall #elif defined(__GNUC__) && __GNUC__ >= 4 #define MS_API_EXPORT(type) __attribute__ ((visibility("default"))) type diff --git a/mapscript/mapscript.i b/mapscript/mapscript.i index 4ccf92daa3..19bd158a55 100644 --- a/mapscript/mapscript.i +++ b/mapscript/mapscript.i @@ -66,7 +66,7 @@ #include "../../mapprimitive.h" #include "../../mapshape.h" -#if defined(WIN32) && defined(SWIGCSHARP) +#if defined(_WIN32) && defined(SWIGCSHARP) /* is needed for GetExceptionCode() for unhandled exception */ #include #endif diff --git a/mapserv.c b/mapserv.c index 288af3af47..9e912721a5 100644 --- a/mapserv.c +++ b/mapserv.c @@ -45,7 +45,7 @@ #include "cpl_conv.h" -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -53,7 +53,7 @@ /************************************************************************/ /* FastCGI cleanup functions. */ /************************************************************************/ -#ifndef WIN32 +#ifndef _WIN32 void msCleanupOnSignal( int nInData ) { /* For some reason, the fastcgi message code does not seem to work */ @@ -68,7 +68,7 @@ void msCleanupOnSignal( int nInData ) } #endif -#ifdef WIN32 +#ifdef _WIN32 void msCleanupOnExit( void ) { /* note that stderr and stdout seem to be non-functional in the */ @@ -246,7 +246,7 @@ int main(int argc, char *argv[]) /* -------------------------------------------------------------------- */ /* Setup cleanup magic, mainly for FastCGI case. */ /* -------------------------------------------------------------------- */ -#ifndef WIN32 +#ifndef _WIN32 signal( SIGUSR1, msCleanupOnSignal ); signal( SIGTERM, msCleanupOnSignal ); #endif diff --git a/mapserver.h b/mapserver.h index 143b9c54b0..6fb124de14 100644 --- a/mapserver.h +++ b/mapserver.h @@ -148,7 +148,7 @@ typedef const ms_uint32 *ms_const_bitarray; /* EQUAL and EQUALN are defined in cpl_port.h, so add them in here if ogr was not included */ #ifndef EQUAL -#if defined(WIN32) || defined(WIN32CE) +#if defined(_WIN32) || defined(WIN32CE) # define EQUAL(a,b) (stricmp(a,b)==0) #else # define EQUAL(a,b) (strcasecmp(a,b)==0) @@ -156,7 +156,7 @@ typedef const ms_uint32 *ms_const_bitarray; #endif #ifndef EQUALN -#if defined(WIN32) || defined(WIN32CE) +#if defined(_WIN32) || defined(WIN32CE) # define EQUALN(a,b,n) (strnicmp(a,b,n)==0) #else # define EQUALN(a,b,n) (strncasecmp(a,b,n)==0) diff --git a/mapwms.c b/mapwms.c index 73fd55131e..65f9b18528 100644 --- a/mapwms.c +++ b/mapwms.c @@ -48,7 +48,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #endif