[tepl/master.msvc: 7/8] testsuite/test-file.c: Fix build on Windows



commit b6224a9356ed2eb4338d305f3dc5a19a76d92931
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Apr 28 17:16:37 2020 +0800

    testsuite/test-file.c: Fix build on Windows
    
    Windows do not come with the (posix) sleep() function, but does come
    with Sleep(), so use that function and pretend that we have sleep() on
    Windows.

 testsuite/test-file.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/test-file.c b/testsuite/test-file.c
index a7c88f1..b09f3ca 100644
--- a/testsuite/test-file.c
+++ b/testsuite/test-file.c
@@ -18,7 +18,13 @@
  */
 
 #include <tepl/tepl.h>
-#include <unistd.h>
+
+#ifdef G_OS_WIN32
+# include <windows.h>
+# define sleep(x) Sleep (x * 1000)
+#else
+# include <unistd.h>
+#endif
 
 static void
 load_cb (GObject      *source_object,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]