Procházet zdrojové kódy

compat: Don't use _pipe when building for winstore

Hugo Beauzée-Luyssen před 6 roky
rodič
revize
45e48b7772
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      compat/compat.h

+ 7 - 2
compat/compat.h

@@ -66,13 +66,18 @@ char *strndup(const char *str, size_t n);
 #endif
 
 #if !defined(HAVE_PIPE) && defined(HAVE__PIPE)
-#include <fcntl.h>
-#define HAVE_PIPE
+# ifdef _WIN32
+#  include <winapifamily.h>
+# endif
+# if !defined(_WIN32) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#  include <fcntl.h>
+#  define HAVE_PIPE
 static inline int pipe(int fds[2])
 {
     return _pipe(fds, 32768, O_NOINHERIT | O_BINARY);
 }
 #endif
+#endif
 
 #ifndef _WIN32
 #define closesocket(fd) close(fd)