Skip to content

Commit ecb47d4

Browse files
committed
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
1 parent 6849603 commit ecb47d4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

mapregex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636

3737
/* We want these to match the POSIX standard, so we need these*/
3838
/* === regex2.h === */
39-
#ifdef WIN32
39+
#ifdef _WIN32
4040
#define MS_API_EXPORT(type) __declspec(dllexport) type __stdcall
4141
#elif defined(__GNUC__) && __GNUC__ >= 4
4242
#define MS_API_EXPORT(type) __attribute__ ((visibility("default"))) type

mapscript/mapscript.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#include "../../mapprimitive.h"
6767
#include "../../mapshape.h"
6868

69-
#if defined(WIN32) && defined(SWIGCSHARP)
69+
#if defined(_WIN32) && defined(SWIGCSHARP)
7070
/* <windows.h> is needed for GetExceptionCode() for unhandled exception */
7171
#include <windows.h>
7272
#endif

mapserv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545

4646
#include "cpl_conv.h"
4747

48-
#ifndef WIN32
48+
#ifndef _WIN32
4949
#include <signal.h>
5050
#endif
5151

5252

5353
/************************************************************************/
5454
/* FastCGI cleanup functions. */
5555
/************************************************************************/
56-
#ifndef WIN32
56+
#ifndef _WIN32
5757
void msCleanupOnSignal( int nInData )
5858
{
5959
/* For some reason, the fastcgi message code does not seem to work */
@@ -68,7 +68,7 @@ void msCleanupOnSignal( int nInData )
6868
}
6969
#endif
7070

71-
#ifdef WIN32
71+
#ifdef _WIN32
7272
void msCleanupOnExit( void )
7373
{
7474
/* note that stderr and stdout seem to be non-functional in the */
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
246246
/* -------------------------------------------------------------------- */
247247
/* Setup cleanup magic, mainly for FastCGI case. */
248248
/* -------------------------------------------------------------------- */
249-
#ifndef WIN32
249+
#ifndef _WIN32
250250
signal( SIGUSR1, msCleanupOnSignal );
251251
signal( SIGTERM, msCleanupOnSignal );
252252
#endif

mapserver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ typedef const ms_uint32 *ms_const_bitarray;
148148
/* EQUAL and EQUALN are defined in cpl_port.h, so add them in here if ogr was not included */
149149

150150
#ifndef EQUAL
151-
#if defined(WIN32) || defined(WIN32CE)
151+
#if defined(_WIN32) || defined(WIN32CE)
152152
# define EQUAL(a,b) (stricmp(a,b)==0)
153153
#else
154154
# define EQUAL(a,b) (strcasecmp(a,b)==0)
155155
#endif
156156
#endif
157157

158158
#ifndef EQUALN
159-
#if defined(WIN32) || defined(WIN32CE)
159+
#if defined(_WIN32) || defined(WIN32CE)
160160
# define EQUALN(a,b,n) (strnicmp(a,b,n)==0)
161161
#else
162162
# define EQUALN(a,b,n) (strncasecmp(a,b,n)==0)

mapwms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include <time.h>
4949
#include <string.h>
5050

51-
#ifdef WIN32
51+
#ifdef _WIN32
5252
#include <process.h>
5353
#endif
5454

0 commit comments

Comments
 (0)