From: Eric Engestrom Date: Thu, 1 Aug 2019 13:58:52 +0000 (+0100) Subject: gallium: deduplicate os detection logic by using detect_os.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a5148190a30c6d710035a64573b745d2e3c54b5;p=mesa.git gallium: deduplicate os detection logic by using detect_os.h This allows us to avoid having to rename all the PIPE_OS_* at once while still making sure PIPE_OS_* and DETECT_OS_* are always in sync. Signed-off-by: Eric Engestrom Reviewed-by: Matt Turner --- diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index ca14da66ef7..5c51ad41842 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -144,71 +144,62 @@ /* * Auto-detect the operating system family. */ +#include "util/detect_os.h" -#if defined(__linux__) +#if DETECT_OS_LINUX #define PIPE_OS_LINUX +#endif + +#if DETECT_OS_UNIX #define PIPE_OS_UNIX #endif -/* - * Android defines __linux__ so PIPE_OS_LINUX and PIPE_OS_UNIX will also be - * defined. - */ -#if defined(ANDROID) +#if DETECT_OS_ANDROID #define PIPE_OS_ANDROID #endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if DETECT_OS_FREEBSD #define PIPE_OS_FREEBSD +#endif + +#if DETECT_OS_BSD #define PIPE_OS_BSD -#define PIPE_OS_UNIX #endif -#if defined(__OpenBSD__) +#if DETECT_OS_OPENBSD #define PIPE_OS_OPENBSD -#define PIPE_OS_BSD -#define PIPE_OS_UNIX #endif -#if defined(__NetBSD__) +#if DETECT_OS_NETBSD #define PIPE_OS_NETBSD -#define PIPE_OS_BSD -#define PIPE_OS_UNIX #endif -#if defined(__DragonFly__) +#if DETECT_OS_DRAGONFLY #define PIPE_OS_DRAGONFLY -#define PIPE_OS_BSD -#define PIPE_OS_UNIX #endif -#if defined(__GNU__) +#if DETECT_OS_HURD #define PIPE_OS_HURD -#define PIPE_OS_UNIX #endif -#if defined(__sun) +#if DETECT_OS_SOLARIS #define PIPE_OS_SOLARIS -#define PIPE_OS_UNIX #endif -#if defined(__APPLE__) +#if DETECT_OS_APPLE #define PIPE_OS_APPLE -#define PIPE_OS_UNIX #endif -#if defined(_WIN32) || defined(WIN32) +#if DETECT_OS_WINDOWS #define PIPE_OS_WINDOWS #endif -#if defined(__HAIKU__) +#if DETECT_OS_HAIKU #define PIPE_OS_HAIKU -#define PIPE_OS_UNIX #endif -#if defined(__CYGWIN__) +#if DETECT_OS_CYGWIN #define PIPE_OS_CYGWIN -#define PIPE_OS_UNIX #endif #endif /* P_CONFIG_H_ */