summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
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_ */