Skip to content

Commit

Permalink
mapserver.h: check _WIN32 instead of WIN32
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MaxKellermann committed Oct 5, 2021
1 parent 1c14821 commit 66d3a17
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mapregex.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mapscript/mapscript.i
Expand Up @@ -66,7 +66,7 @@
#include "../../mapprimitive.h"
#include "../../mapshape.h"

#if defined(WIN32) && defined(SWIGCSHARP)
#if defined(_WIN32) && defined(SWIGCSHARP)
/* <windows.h> is needed for GetExceptionCode() for unhandled exception */
#include <windows.h>
#endif
Expand Down
8 changes: 4 additions & 4 deletions mapserv.c
Expand Up @@ -45,7 +45,7 @@

#include "cpl_conv.h"

#ifndef WIN32
#ifndef _WIN32
#include <signal.h>
#endif

Expand All @@ -56,15 +56,15 @@

static int finish_process = 0;

#ifndef WIN32
#ifndef _WIN32
static void msCleanupOnSignal( int nInData )
{
(void)nInData;
finish_process = 1;
}
#endif

#ifdef WIN32
#ifdef _WIN32
static void msCleanupOnExit( void )
{
finish_process = 1;
Expand Down Expand Up @@ -237,7 +237,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
Expand Down
4 changes: 2 additions & 2 deletions mapserver.h
Expand Up @@ -148,15 +148,15 @@ 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)
#endif
#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)
Expand Down
2 changes: 1 addition & 1 deletion mapwms.cpp
Expand Up @@ -53,7 +53,7 @@
#include <string>
#include <vector>

#ifdef WIN32
#ifdef _WIN32
#include <process.h>
#endif

Expand Down

0 comments on commit 66d3a17

Please sign in to comment.