gallium: Identify each Windows platform individually from scons.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 2 Jun 2008 10:36:53 +0000 (19:36 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 2 Jun 2008 10:46:18 +0000 (19:46 +0900)
common.py
src/gallium/include/pipe/p_config.h

index 8b70e9b..b6251d3 100644 (file)
--- a/common.py
+++ b/common.py
@@ -210,9 +210,11 @@ def generate(env):
                        'TEST_EXPORTS' ,
                ]
        if platform == 'windows':
-               cppdefines += ['PIPE_SUBSYSTEM_USER']
+               cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
        if platform == 'winddk':
-               cppdefines += ['PIPE_SUBSYSTEM_KERNEL']
+               cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_DISPLAY']
+       if platform == 'wince':
+               cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
        env.Append(CPPDEFINES = cppdefines)
 
        # C compiler options
index d2d2ae1..af3746c 100644 (file)
  * architecture, and operating system being used. These defines should be used 
  * throughout the code to facilitate porting to new platforms. It is likely that 
  * this file is auto-generated by an autoconf-like tool at some point, as some 
- * things cannot be determined by existing defines alone. 
+ * things cannot be determined by pre-defined environment alone. 
  * 
  * See also:
  * - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
  * - echo | gcc -dM -E - | sort
  * - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+ * 
  * @author José Fonseca <jrfonseca@tungstengraphics.com>
  */
 
 #define PIPE_CC_GCC
 #endif
 
+/*
+ * Meaning of _MSC_VER value:
+ * - 1400: Visual C++ 2005
+ * - 1310: Visual C++ .NET 2003
+ * - 1300: Visual C++ .NET 2002
+ * 
+ * __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC 
+ * versions.
+ */
 #if defined(_MSC_VER) || defined(__MSC__)
 #define PIPE_CC_MSVC
 #endif
@@ -81,7 +91,9 @@
 
 
 /*
- * Operating system
+ * Operating system family.
+ * 
+ * See subsystem below for a more fine-grained distinction.
  */
 
 #if defined(__linux__)
 
 
 /*
- * Subsystem
+ * Subsystem.
  * 
- * XXX: There is no way to autodetect this.
+ * NOTE: There is no way to auto-detect most of these.
  */
 
 #if defined(PIPE_OS_LINUX)
 #define PIPE_SUBSYSTEM_DRI
-#endif
+#endif /* PIPE_OS_LINUX */
 
 #if defined(PIPE_OS_WINDOWS)
-#ifndef _WIN32_WCE
-#if !defined(PIPE_SUBSYSTEM_USER) && !defined(PIPE_SUBSYSTEM_KERNEL)
-#error Neither PIPE_SUBSYSTEM_USER or PIPE_SUBSYSTEM_KERNEL defined.
-#endif
-#if defined(PIPE_SUBSYSTEM_KERNEL)
-#define PIPE_SUBSYSTEM_WINDOWS_DISPLAY
-#endif
-#if 0 /* FIXME */
-#define PIPE_SUBSYSTEM_WINDOWS_MINIPORT
-#endif
-#if defined(PIPE_SUBSYSTEM_USER)
-#define PIPE_SUBSYSTEM_WINDOWS_USER
-#endif
-#else /* _WIN32_WCE */
+#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
+/* Windows 2000/XP Display Driver */ 
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
+/* Windows 2000/XP Miniport Driver */ 
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+/* Windows User-space Library */
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE)
+/* Windows CE 5.0/6.0 */
+#else
+#ifdef _WIN32_WCE
 #define PIPE_SUBSYSTEM_WINDOWS_CE
-#endif /* _WIN32_WCE */
+#else /* !_WIN32_WCE */
+#error No PIPE_SUBSYSTEM_WINDOWS_xxx subsystem defined. 
+#endif /* !_WIN32_WCE */
+#endif
 #endif /* PIPE_OS_WINDOWS */