PIPE_ARCH_*_ENDIAN is replaced by UTIL_ARCH_*_ENDIAN. We also differ from Mesa in how arch and endianness are detected. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com> Acked-by: Gert Wollny <gert.wollny@collabora.com>macos/master
parent
90ab7ae537
commit
49403c1dfd
@ -0,0 +1,131 @@ |
||||
/* SPDX-License-Identifier: MIT */ |
||||
/* Copyright 2008 VMware, Inc. */ |
||||
|
||||
/**
|
||||
* Auto-detect the operating system family. |
||||
* |
||||
* 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 <jfonseca@vmware.com> |
||||
*/ |
||||
|
||||
#ifndef DETECT_OS_H |
||||
#define DETECT_OS_H |
||||
|
||||
#if defined(__linux__) |
||||
#define DETECT_OS_LINUX 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
/*
|
||||
* Android defines __linux__, so DETECT_OS_LINUX and DETECT_OS_UNIX will |
||||
* also be defined. |
||||
*/ |
||||
#if defined(ANDROID) |
||||
#define DETECT_OS_ANDROID 1 |
||||
#endif |
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
||||
#define DETECT_OS_FREEBSD 1 |
||||
#define DETECT_OS_BSD 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__OpenBSD__) |
||||
#define DETECT_OS_OPENBSD 1 |
||||
#define DETECT_OS_BSD 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__NetBSD__) |
||||
#define DETECT_OS_NETBSD 1 |
||||
#define DETECT_OS_BSD 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__DragonFly__) |
||||
#define DETECT_OS_DRAGONFLY 1 |
||||
#define DETECT_OS_BSD 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__GNU__) |
||||
#define DETECT_OS_HURD 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__sun) |
||||
#define DETECT_OS_SOLARIS 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__APPLE__) |
||||
#define DETECT_OS_APPLE 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(_WIN32) || defined(WIN32) |
||||
#define DETECT_OS_WINDOWS 1 |
||||
#endif |
||||
|
||||
#if defined(__HAIKU__) |
||||
#define DETECT_OS_HAIKU 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
#if defined(__CYGWIN__) |
||||
#define DETECT_OS_CYGWIN 1 |
||||
#define DETECT_OS_UNIX 1 |
||||
#endif |
||||
|
||||
|
||||
/*
|
||||
* Make sure DETECT_OS_* are always defined, so that they can be used with #if |
||||
*/ |
||||
#ifndef DETECT_OS_ANDROID |
||||
#define DETECT_OS_ANDROID 0 |
||||
#endif |
||||
#ifndef DETECT_OS_APPLE |
||||
#define DETECT_OS_APPLE 0 |
||||
#endif |
||||
#ifndef DETECT_OS_BSD |
||||
#define DETECT_OS_BSD 0 |
||||
#endif |
||||
#ifndef DETECT_OS_CYGWIN |
||||
#define DETECT_OS_CYGWIN 0 |
||||
#endif |
||||
#ifndef DETECT_OS_DRAGONFLY |
||||
#define DETECT_OS_DRAGONFLY 0 |
||||
#endif |
||||
#ifndef DETECT_OS_FREEBSD |
||||
#define DETECT_OS_FREEBSD 0 |
||||
#endif |
||||
#ifndef DETECT_OS_HAIKU |
||||
#define DETECT_OS_HAIKU 0 |
||||
#endif |
||||
#ifndef DETECT_OS_HURD |
||||
#define DETECT_OS_HURD 0 |
||||
#endif |
||||
#ifndef DETECT_OS_LINUX |
||||
#define DETECT_OS_LINUX 0 |
||||
#endif |
||||
#ifndef DETECT_OS_NETBSD |
||||
#define DETECT_OS_NETBSD 0 |
||||
#endif |
||||
#ifndef DETECT_OS_OPENBSD |
||||
#define DETECT_OS_OPENBSD 0 |
||||
#endif |
||||
#ifndef DETECT_OS_SOLARIS |
||||
#define DETECT_OS_SOLARIS 0 |
||||
#endif |
||||
#ifndef DETECT_OS_UNIX |
||||
#define DETECT_OS_UNIX 0 |
||||
#endif |
||||
#ifndef DETECT_OS_WINDOWS |
||||
#define DETECT_OS_WINDOWS 0 |
||||
#endif |
||||
|
||||
#endif /* DETECT_OS_H */ |
@ -0,0 +1,38 @@ |
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007-2008 VMware, Inc. |
||||
* All Rights Reserved. |
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and associated documentation files (the |
||||
* "Software"), to deal in the Software without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sub license, and/or sell copies of the Software, and to |
||||
* permit persons to whom the Software is furnished to do so, subject to |
||||
* the following conditions: |
||||
*
|
||||
* The above copyright notice and this permission notice (including the |
||||
* next paragraph) shall be included in all copies or substantial portions |
||||
* of the Software. |
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR |
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||
*
|
||||
**************************************************************************/ |
||||
#ifndef U_ENDIAN_H |
||||
#define U_ENDIAN_H |
||||
|
||||
/* (virglrenderer) Detected by meson */ |
||||
|
||||
#if !defined(UTIL_ARCH_LITTLE_ENDIAN) || !defined(UTIL_ARCH_BIG_ENDIAN) |
||||
# error "UTIL_ARCH_LITTLE_ENDIAN and/or UTIL_ARCH_BIG_ENDIAN were unset." |
||||
#elif UTIL_ARCH_LITTLE_ENDIAN == UTIL_ARCH_BIG_ENDIAN |
||||
# error "UTIL_ARCH_LITTLE_ENDIAN and UTIL_ARCH_BIG_ENDIAN must not both be 1 or 0." |
||||
#endif |
||||
|
||||
#endif |
Loading…
Reference in new issue