summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-08-01 14:58:52 +0100
committerEric Engestrom <[email protected]>2019-08-02 18:38:52 +0100
commit9a5148190a30c6d710035a64573b745d2e3c54b5 (patch)
tree1d6a719fd0fe411a55b2264a799f2810260db6e7 /src/gallium
parent8c52bca11228a7d514cfbcb1c6605c2140949b06 (diff)
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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/include/pipe/p_config.h47
1 files changed, 19 insertions, 28 deletions
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_ */