Path: blob/21.2-virgl/src/gallium/include/pipe/p_config.h
4565 views
/**************************************************************************1*2* Copyright 2008 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/**28* @file29* Gallium configuration defines.30*31* This header file sets several defines based on the compiler, processor32* architecture, and operating system being used. These defines should be used33* throughout the code to facilitate porting to new platforms. It is likely that34* this file is auto-generated by an autoconf-like tool at some point, as some35* things cannot be determined by pre-defined environment alone.36*37* See also:38* - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html39* - echo | gcc -dM -E - | sort40* - http://msdn.microsoft.com/en-us/library/b0084kay.aspx41*42* @author José Fonseca <[email protected]>43*/4445#ifndef P_CONFIG_H_46#define P_CONFIG_H_4748#include <limits.h>49/*50* Compiler51*/5253#if defined(__GNUC__)54#define PIPE_CC_GCC55#define PIPE_CC_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)56#endif5758/*59* Meaning of _MSC_VER value:60* - 1800: Visual Studio 201361* - 1700: Visual Studio 201262* - 1600: Visual Studio 201063* - 1500: Visual Studio 200864* - 1400: Visual C++ 200565* - 1310: Visual C++ .NET 200366* - 1300: Visual C++ .NET 200267*68* __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC69* versions.70*/71#if defined(_MSC_VER) || defined(__MSC__)72#define PIPE_CC_MSVC73#endif7475#if defined(__ICL)76#define PIPE_CC_ICL77#endif787980/*81* Processor architecture82*/8384#if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || defined(_X86_) || defined(__386__) || defined(i386) || defined(__i386) /* Sun cc */85#define PIPE_ARCH_X8686#endif8788#if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || defined(_M_AMD64) /* msvc */ || defined(__x86_64) /* Sun cc */89#define PIPE_ARCH_X86_6490#endif9192#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)93#if defined(PIPE_CC_GCC) && !defined(__SSE2__)94/* #warning SSE2 support requires -msse -msse2 compiler options */95#else96#define PIPE_ARCH_SSE97#endif98#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 && !defined(__SSSE3__)99/* #warning SSE3 support requires -msse3 compiler options before GCC 4.9 */100#else101#define PIPE_ARCH_SSSE3102#endif103#endif104105#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__)106#define PIPE_ARCH_PPC107#if defined(__ppc64__) || defined(__PPC64__)108#define PIPE_ARCH_PPC_64109#endif110#endif111112#if defined(__s390x__)113#define PIPE_ARCH_S390114#endif115116#if defined(__arm__)117#define PIPE_ARCH_ARM118#endif119120#if defined(__aarch64__) || defined(_M_ARM64)121#define PIPE_ARCH_AARCH64122#endif123124/*125* Endian detection.126*/127128#include "util/u_endian.h"129130/*131* Auto-detect the operating system family.132*/133#include "util/detect_os.h"134135#if DETECT_OS_LINUX136#define PIPE_OS_LINUX137#endif138139#if DETECT_OS_UNIX140#define PIPE_OS_UNIX141#endif142143#if DETECT_OS_ANDROID144#define PIPE_OS_ANDROID145#endif146147#if DETECT_OS_FREEBSD148#define PIPE_OS_FREEBSD149#endif150151#if DETECT_OS_BSD152#define PIPE_OS_BSD153#endif154155#if DETECT_OS_OPENBSD156#define PIPE_OS_OPENBSD157#endif158159#if DETECT_OS_NETBSD160#define PIPE_OS_NETBSD161#endif162163#if DETECT_OS_DRAGONFLY164#define PIPE_OS_DRAGONFLY165#endif166167#if DETECT_OS_HURD168#define PIPE_OS_HURD169#endif170171#if DETECT_OS_SOLARIS172#define PIPE_OS_SOLARIS173#endif174175#if DETECT_OS_APPLE176#define PIPE_OS_APPLE177#endif178179#if DETECT_OS_WINDOWS180#define PIPE_OS_WINDOWS181#endif182183#if DETECT_OS_HAIKU184#define PIPE_OS_HAIKU185#endif186187#if DETECT_OS_CYGWIN188#define PIPE_OS_CYGWIN189#endif190191#endif /* P_CONFIG_H_ */192193194