[Mesa-dev] [PATCH] Use the correct macro _WIN32 for Windows.

Vinson Lee vlee at freedesktop.org
Tue Sep 4 23:12:53 PDT 2012


Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/gallium/auxiliary/util/u_snprintf.c |    2 +-
 src/gallium/auxiliary/util/u_string.h   |    4 ++--
 src/gallium/tests/graw/fs-test.c        |    2 +-
 src/gallium/tests/graw/gs-test.c        |    2 +-
 src/gallium/tests/graw/vs-test.c        |    2 +-
 src/glx/glxclient.h                     |    2 +-
 src/mapi/glapi/gen/gl_x86-64_asm.py     |    2 +-
 src/mapi/glapi/gen/gl_x86_asm.py        |    2 +-
 src/mapi/glapi/glapi_dispatch.c         |    2 +-
 src/mapi/mapi/u_current.c               |    2 +-
 src/mapi/mapi/u_thread.h                |    4 ++--
 src/mesa/main/compiler.h                |    6 +++---
 src/mesa/main/imports.c                 |    2 +-
 src/mesa/x86/common_x86.c               |    6 +++---
 14 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c
index f0d53b3..e16f103 100644
--- a/src/gallium/auxiliary/util/u_snprintf.c
+++ b/src/gallium/auxiliary/util/u_snprintf.c
@@ -167,7 +167,7 @@
 #if HAVE_CONFIG_H
 #include <config.h>
 #else
-#ifdef WIN32
+#ifdef _WIN32
 #define vsnprintf util_vsnprintf
 #define snprintf util_snprintf
 #define HAVE_VSNPRINTF 0
diff --git a/src/gallium/auxiliary/util/u_string.h b/src/gallium/auxiliary/util/u_string.h
index ed15981..15630ad 100644
--- a/src/gallium/auxiliary/util/u_string.h
+++ b/src/gallium/auxiliary/util/u_string.h
@@ -35,7 +35,7 @@
 #ifndef U_STRING_H_
 #define U_STRING_H_
 
-#if !defined(WIN32) && !defined(XF86_LIBC_H)
+#if !defined(_WIN32) && !defined(XF86_LIBC_H)
 #include <stdio.h>
 #endif
 #include <stddef.h>
@@ -64,7 +64,7 @@ util_strchrnul(const char *s, char c)
 
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 
 int util_vsnprintf(char *, size_t, const char *, va_list);
 int util_snprintf(char *str, size_t size, const char *format, ...);
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index 1c0d514..ffb6bd2 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -22,7 +22,7 @@ unsigned show_fps = 0;
 static void usage(char *name)
 {
    fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
-#ifndef WIN32
+#ifndef _WIN32
    fprintf(stderr, "\n" );
    fprintf(stderr, "options:\n");
    fprintf(stderr, "    -fps  show frames per second\n");
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 52eb600..48db759 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -23,7 +23,7 @@ unsigned draw_strip = 0;
 static void usage(char *name)
 {
    fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
-#ifndef WIN32
+#ifndef _WIN32
    fprintf(stderr, "\n" );
    fprintf(stderr, "options:\n");
    fprintf(stderr, "    -fps  show frames per second\n");
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index ad524c4..d01cdf8 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -23,7 +23,7 @@ unsigned show_fps = 0;
 static void usage(char *name)
 {
    fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
-#ifndef WIN32
+#ifndef _WIN32
    fprintf(stderr, "\n" );
    fprintf(stderr, "options:\n");
    fprintf(stderr, "    -fps  show frames per second\n");
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index 91577a8..087f238 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -47,7 +47,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#ifdef WIN32
+#ifdef _WIN32
 #include <stdint.h>
 #endif
 #include "GL/glxproto.h"
diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py
index ef759bf..3ef5e08 100644
--- a/src/mapi/glapi/gen/gl_x86-64_asm.py
+++ b/src/mapi/glapi/gen/gl_x86-64_asm.py
@@ -138,7 +138,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '#  define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
 		print '# endif'
 		print ''
-		print '#if defined(PTHREADS) || defined(WIN32)'
+		print '#if defined(PTHREADS) || defined(_WIN32)'
 		print '#  define THREADS'
 		print '#endif'
 		print ''
diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
index b43b65d..095edcd 100644
--- a/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/src/mapi/glapi/gen/gl_x86_asm.py
@@ -78,7 +78,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '#define GLOBL_FN(x) GLOBL x'
 		print '#endif'
 		print ''
-		print '#if defined(PTHREADS) || defined(WIN32)'
+		print '#if defined(PTHREADS) || defined(_WIN32)'
 		print '#  define THREADS'
 		print '#endif'
 		print ''
diff --git a/src/mapi/glapi/glapi_dispatch.c b/src/mapi/glapi/glapi_dispatch.c
index 989f4a3..be65ebe 100644
--- a/src/mapi/glapi/glapi_dispatch.c
+++ b/src/mapi/glapi/glapi_dispatch.c
@@ -43,7 +43,7 @@
 
 #if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
 
-#if defined(WIN32)
+#if defined(_WIN32)
 #define KEYWORD1 GLAPI
 #else
 #define KEYWORD1 PUBLIC
diff --git a/src/mapi/mapi/u_current.c b/src/mapi/mapi/u_current.c
index 21a07ab..d902375 100644
--- a/src/mapi/mapi/u_current.c
+++ b/src/mapi/mapi/u_current.c
@@ -125,7 +125,7 @@ static int ThreadSafe;
 void
 u_current_destroy(void)
 {
-#if defined(THREADS) && defined(WIN32)
+#if defined(THREADS) && defined(_WIN32)
    u_tsd_destroy(&u_current_table_tsd);
    u_tsd_destroy(&u_current_user_tsd);
 #endif
diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h
index ffe17b2..e53f872 100644
--- a/src/mapi/mapi/u_thread.h
+++ b/src/mapi/mapi/u_thread.h
@@ -153,7 +153,7 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
  * IMPORTANT: Link with multithreaded runtime library when THREADS are
  * used!
  */
-#ifdef WIN32
+#ifdef _WIN32
 
 struct u_tsd {
    DWORD key;
@@ -225,7 +225,7 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
    }
 }
 
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /*
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 94484d8..b1f6d27 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -90,7 +90,7 @@ extern "C" {
 /**
  * Disable assorted warnings
  */
-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
+#if !defined(OPENSTEP) && (defined(_WIN32) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
 #  if !defined(__GNUC__) /* mingw environment */
 #    pragma warning( disable : 4068 ) /* unknown pragma */
 #    pragma warning( disable : 4710 ) /* function 'foo' not inlined */
@@ -257,7 +257,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
 
 
 
-#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP)
+#if !defined(CAPI) && defined(_WIN32) && !defined(BUILD_FOR_SNAP)
 #define CAPI _cdecl
 #endif
 
@@ -267,7 +267,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
  * than GNU C
  */
 #ifndef _ASMAPI
-#if defined(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/
+#if defined(_WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/
 #define _ASMAPI __cdecl
 #else
 #define _ASMAPI
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 0d6b56a..9b5f856 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -57,7 +57,7 @@
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #define vsnprintf _vsnprintf
 #elif defined(__IBMC__) || defined(__IBMCPP__) || ( defined(__VMS) && __CRTL_VER < 70312000 )
 extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index b70ee50..6299507 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -82,7 +82,7 @@ extern void _mesa_test_os_sse_support( void );
 extern void _mesa_test_os_sse_exception_support( void );
 
 
-#if defined(WIN32)
+#if defined(_WIN32)
 #ifndef STATUS_FLOAT_MULTIPLE_TRAPS
 # define STATUS_FLOAT_MULTIPLE_TRAPS (0xC00002B5L)
 #endif
@@ -110,7 +110,7 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp)
 
    return EXCEPTION_CONTINUE_EXECUTION;
 }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 
 /**
@@ -149,7 +149,7 @@ void _mesa_check_os_sse_support( void )
       if (ret || !enabled)
          _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
    }
-#elif defined(WIN32)
+#elif defined(_WIN32)
    LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;
    
    /* Install our ExceptionFilter */
-- 
1.7.10.4



More information about the mesa-dev mailing list