[gtk/gtk-3-24-meson: 10/94] tests: Include system headers appropriately



commit b2a6342d5830ec89efc9de6a25a0ae76741a68bc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jul 21 16:00:44 2017 +0800

    tests: Include system headers appropriately
    
    Don't include unistd.h on Windows, and include the appropriate headers on
    Windows as necessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773299

 tests/testanimation.c                  | 5 ++++-
 testsuite/a11y/accessibility-dump.c    | 4 ++++
 testsuite/css/nodes/test-css-nodes.c   | 4 ++++
 testsuite/css/parser/test-css-parser.c | 4 ++++
 testsuite/css/style/test-css-style.c   | 4 ++++
 testsuite/reftests/gtk-reftest.c       | 4 ++++
 6 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/tests/testanimation.c b/tests/testanimation.c
index 356b8827d2..8bd43a6c66 100644
--- a/tests/testanimation.c
+++ b/tests/testanimation.c
@@ -19,11 +19,14 @@
 #include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #include <errno.h>
 #include <gtk/gtk.h>
 
+#ifndef G_OS_WIN32
+# include <unistd.h>
+#endif
+
 typedef struct _LoadContext LoadContext;
 
 struct _LoadContext
diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c
index 67747d4c05..2986f297f6 100644
--- a/testsuite/a11y/accessibility-dump.c
+++ b/testsuite/a11y/accessibility-dump.c
@@ -25,6 +25,10 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+# include <io.h>
+#endif
+
 #define DEPTH_INCREMENT 2
 
 static char *
diff --git a/testsuite/css/nodes/test-css-nodes.c b/testsuite/css/nodes/test-css-nodes.c
index bb0b02cc48..334b60a11c 100644
--- a/testsuite/css/nodes/test-css-nodes.c
+++ b/testsuite/css/nodes/test-css-nodes.c
@@ -22,6 +22,10 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+# include <io.h>
+#endif
+
 
 static char *
 test_get_reference_file (const char *ui_file)
diff --git a/testsuite/css/parser/test-css-parser.c b/testsuite/css/parser/test-css-parser.c
index a5bb173075..c925d89bfa 100644
--- a/testsuite/css/parser/test-css-parser.c
+++ b/testsuite/css/parser/test-css-parser.c
@@ -26,6 +26,10 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+# include <io.h>
+#endif
+
 static char *
 test_get_reference_file (const char *css_file)
 {
diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c
index 53fac070e5..0992223ac0 100644
--- a/testsuite/css/style/test-css-style.c
+++ b/testsuite/css/style/test-css-style.c
@@ -22,6 +22,10 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+# include <io.h>
+#endif
+
 /* There shall be no other styles */
 #define GTK_STYLE_PROVIDER_PRIORITY_FORCE G_MAXUINT
 
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 4930af8184..6400b26ecf 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -28,6 +28,10 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+# include <direct.h>
+#endif
+
 typedef enum {
   SNAPSHOT_WINDOW,
   SNAPSHOT_DRAW


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