[pango] tests: Don't include unistd.h unconditionally



commit 9b11f357f9f968849c70044eaac5d43713436c94
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed May 31 17:28:37 2017 +0800

    tests: Don't include unistd.h unconditionally
    
    Don't include unistd.h on Windows, and include io.h if necessary,
    as Windows compilers may not ship with it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783274

 tests/test-common.c    |    8 +++++++-
 tests/test-layout.c    |    5 ++++-
 tests/testboundaries.c |    5 ++++-
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/tests/test-common.c b/tests/test-common.c
index 17b5df3..adeb4b6 100644
--- a/tests/test-common.c
+++ b/tests/test-common.c
@@ -21,9 +21,15 @@
 
 #include <glib.h>
 #include <string.h>
-#include <unistd.h>
+
 #include <locale.h>
 
+#ifdef G_OS_WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
 #include <pango/pangocairo.h>
 #include "test-common.h"
 
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 75af21b..0a6a2c1 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -21,9 +21,12 @@
 
 #include <glib.h>
 #include <string.h>
-#include <unistd.h>
 #include <locale.h>
 
+#ifndef G_OS_WIN32
+#include <unistd.h>
+#endif
+
 #include <pango/pangocairo.h>
 #include "test-common.h"
 
diff --git a/tests/testboundaries.c b/tests/testboundaries.c
index 2f7a79b..75da772 100644
--- a/tests/testboundaries.c
+++ b/tests/testboundaries.c
@@ -22,11 +22,14 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <unistd.h>
 
 #include <glib.h>
 #include <pango/pango.h>
 
+#ifndef G_OS_WIN32
+#include <unistd.h>
+#endif
+
 #define CHFORMAT "%0#6x"
 
 /* FIXME for now this just tests that the breaking of some sample


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