Mesa (master): util/os_file: replace broken windows-detection code with detect_os.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 18 02:25:51 UTC 2020


Module: Mesa
Branch: master
Commit: b00e1d9ea77a409cc15e57568284d48bdb9443c2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b00e1d9ea77a409cc15e57568284d48bdb9443c2

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Fri Jun  5 12:39:28 2020 +0200

util/os_file: replace broken windows-detection code with detect_os.h

The meson-windows-vs2019 job was going down the `!defined(WIN32)` path,
leading to a broken build once that path contained non-windows code.

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>

---

 src/util/os_file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/os_file.c b/src/util/os_file.c
index 5771b27e5d0..f02d74afd2c 100644
--- a/src/util/os_file.c
+++ b/src/util/os_file.c
@@ -4,14 +4,14 @@
  */
 
 #include "os_file.h"
+#include "detect_os.h"
 
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
-
-#if defined(WIN32)
+#if DETECT_OS_WINDOWS
 #include <io.h>
 #define open _open
 #define fdopen _fdopen
@@ -31,7 +31,7 @@ os_file_create_unique(const char *filename, int filemode)
 }
 
 
-#if defined(__linux__)
+#if DETECT_OS_LINUX
 
 #include <fcntl.h>
 #include <sys/stat.h>



More information about the mesa-commit mailing list