[tepl/master.msvc: 7/9] testsuite/test-file.c: Fix build on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tepl/master.msvc: 7/9] testsuite/test-file.c: Fix build on Windows
- Date: Thu, 30 Apr 2020 09:17:44 +0000 (UTC)
commit 991370b795b2bd17245bb2828882c5fd209154b2
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]