Commits

Ondřej Surý  committed c60d9fe

Unify the Win32 check to _WIN32 check which is defined by both VC and MinGW

  • Participants
  • Parent commits 3f2813e

Comments (0)

Files changed (8)

    the gd sources in a project. */
 
 /* http://gcc.gnu.org/wiki/Visibility */
-#if defined(WIN32) || defined(CYGWIN) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE)
 # if BGDWIN32
 #  ifdef NONDLL
 #   ifdef __GNUC__

File src/gd_bmp.c

 
 cleanup:
 	if (tmpfile_for_compression) {
-#ifdef WIN32
+#ifdef _WIN32
 		_rmtmp();
 #else
 		fclose(tmpfile_for_compression);

File src/gd_errors.h

 #ifndef GD_ERRORS_H
 #define GD_ERRORS_H
 
-#ifndef WIN32
+#ifndef _WIN32
 # include <syslog.h>
 #else
 /*
 # define LOG_NOTICE      5       /* normal but significant condition */
 # define LOG_INFO        6       /* informational */
 # define LOG_DEBUG       7       /* debug-level messages */
-
 #endif
 
 /*

File src/gd_filter.c

 
 #include "gd.h"
 
-#ifdef WIN32
+#ifdef _WIN32
 # include <windows.h>
 #else
 # include <unistd.h>
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #define MAX(a,b) ((a)<(b)?(b):(a))
 
-#ifdef WIN32
+#ifdef _WIN32
 # define GD_SCATTER_SEED() (unsigned int)(time(0) * GetCurrentProcessId())
 #else
 # define GD_SCATTER_SEED() (unsigned int)(time(0) * getpid())

File src/gd_jpeg.c

 #ifdef HAVE_LIBJPEG
 #include "gdhelpers.h"
 
-#if defined(WIN32) && defined(__MINGW32__)
+#if defined(_WIN32) && defined(__MINGW32__)
 # define HAVE_BOOLEAN
 #endif
 

File src/gdcmpgif.c

 
 #include <stdio.h>
 #include <stdlib.h>
-#ifndef WIN32
+#ifndef _WIN32
 #include <unistd.h> /* For unlink function */
 #endif
 
 #include "entities.h"
 
 /* 2.0.10: WIN32, not MSWIN32 */
-#if !defined(WIN32) && !defined(_WIN32_WCE)
+#if !defined(_WIN32) && !defined(_WIN32_WCE)
 #include <unistd.h>
 #elif defined(_WIN32_WCE)
 #include <wce_stdlib.h> /* getenv() */

File src/gdhelpers.h

 
 	/* 2.0.16: portable mutex support for thread safety. */
 
-#ifdef WIN32
+#if defined(_WIN32)
 	/* 2.0.18: must include windows.h to get CRITICAL_SECTION. */
-#include <windows.h>
-#define gdMutexDeclare(x) CRITICAL_SECTION x
-#define gdMutexSetup(x) InitializeCriticalSection(&x)
-#define gdMutexShutdown(x) DeleteCriticalSection(&x)
-#define gdMutexLock(x) EnterCriticalSection(&x)
-#define gdMutexUnlock(x) LeaveCriticalSection(&x)
+# include <windows.h>
+# define gdMutexDeclare(x) CRITICAL_SECTION x
+# define gdMutexSetup(x) InitializeCriticalSection(&x)
+# define gdMutexShutdown(x) DeleteCriticalSection(&x)
+# define gdMutexLock(x) EnterCriticalSection(&x)
+# define gdMutexUnlock(x) LeaveCriticalSection(&x)
+#elif defined(HAVE_PTHREAD)
+# include <pthread.h>
+# define gdMutexDeclare(x) pthread_mutex_t x
+# define gdMutexSetup(x) pthread_mutex_init(&x, 0)
+# define gdMutexShutdown(x) pthread_mutex_destroy(&x)
+# define gdMutexLock(x) pthread_mutex_lock(&x)
+# define gdMutexUnlock(x) pthread_mutex_unlock(&x)
 #else
-#ifdef HAVE_PTHREAD
-#include <pthread.h>
-#define gdMutexDeclare(x) pthread_mutex_t x
-#define gdMutexSetup(x) pthread_mutex_init(&x, 0)
-#define gdMutexShutdown(x) pthread_mutex_destroy(&x)
-#define gdMutexLock(x) pthread_mutex_lock(&x)
-#define gdMutexUnlock(x) pthread_mutex_unlock(&x)
-#else
-#define gdMutexDeclare(x)
-#define gdMutexSetup(x)
-#define gdMutexShutdown(x)
-#define gdMutexLock(x)
-#define gdMutexUnlock(x)
-#endif /* HAVE_PTHREAD */
-#endif /* WIN32 */
+# define gdMutexDeclare(x)
+# define gdMutexSetup(x)
+# define gdMutexShutdown(x)
+# define gdMutexLock(x)
+# define gdMutexUnlock(x)
+#endif /* _WIN32 || HAVE_PTHREAD */
 
 #define DPCM2DPI(dpcm) (unsigned int)((dpcm)*2.54 + 0.5)
 #define DPM2DPI(dpm)   (unsigned int)((dpm)*0.0254 + 0.5)