1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 * Gallium configuration defines.
32 * This header file sets several defines based on the compiler, processor
33 * architecture, and operating system being used. These defines should be used
34 * throughout the code to facilitate porting to new platforms. It is likely that
35 * this file is auto-generated by an autoconf-like tool at some point, as some
36 * things cannot be determined by pre-defined environment alone.
39 * - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
40 * - echo | gcc -dM -E - | sort
41 * - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
43 * @author José Fonseca <jrfonseca@tungstengraphics.com>
59 * Meaning of _MSC_VER value:
60 * - 1400: Visual C++ 2005
61 * - 1310: Visual C++ .NET 2003
62 * - 1300: Visual C++ .NET 2002
64 * __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC
67 #if defined(_MSC_VER) || defined(__MSC__)
77 * Processor architecture
80 #if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || defined(_X86_) || defined(__386__) || defined(i386)
84 #if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || defined(_M_AMD64) /* msvc */
85 #define PIPE_ARCH_X86_64
94 * Operating system family.
96 * See subsystem below for a more fine-grained distinction.
99 #if defined(__linux__)
100 #define PIPE_OS_LINUX
103 #if defined(_WIN32) || defined(WIN32)
104 #define PIPE_OS_WINDOWS
111 * NOTE: There is no way to auto-detect most of these.
114 #if defined(PIPE_OS_LINUX)
115 #define PIPE_SUBSYSTEM_DRI
116 #endif /* PIPE_OS_LINUX */
118 #if defined(PIPE_OS_WINDOWS)
119 #if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
120 /* Windows 2000/XP Display Driver */
121 #elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
122 /* Windows 2000/XP Miniport Driver */
123 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
124 /* Windows User-space Library */
125 #elif defined(PIPE_SUBSYSTEM_WINDOWS_CE)
126 /* Windows CE 5.0/6.0 */
129 #define PIPE_SUBSYSTEM_WINDOWS_CE
130 #else /* !_WIN32_WCE */
131 #error No PIPE_SUBSYSTEM_WINDOWS_xxx subsystem defined.
132 #endif /* !_WIN32_WCE */
134 #endif /* PIPE_OS_WINDOWS */
137 #endif /* P_CONFIG_H_ */