util/os_file: replace broken windows-detection code with detect_os.h
authorEric Engestrom <eric@engestrom.ch>
Fri, 5 Jun 2020 10:39:28 +0000 (12:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Jun 2020 02:09:56 +0000 (02:09 +0000)
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@engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>

src/util/os_file.c

index 5771b27e5d0730d33a0a3a95235c2432320eb9a8..f02d74afd2ca1158e91cfd750defc783c7cbc2f2 100644 (file)
@@ -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>