From: Chun-wei Fan Date: Tue, 5 Nov 2013 08:08:45 +0000 (+0800) Subject: tests/: Include unistd.h on *NIX only X-Git-Tag: 2.39.1~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=fd41363e0213adda7c274c7ac06b411a17d5619f;p=platform%2Fupstream%2Fglib.git tests/: Include unistd.h on *NIX only https://bugzilla.gnome.org/show_bug.cgi?id=711047 --- diff --git a/tests/child-test.c b/tests/child-test.c index ad055b2..7681701 100644 --- a/tests/child-test.c +++ b/tests/child-test.c @@ -24,16 +24,15 @@ * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -#include "config.h" - #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include +#ifdef G_OS_UNIX +#include +#endif + #ifdef G_OS_WIN32 #include #endif diff --git a/tests/env-test.c b/tests/env-test.c index 5fd75df..b75eb42 100644 --- a/tests/env-test.c +++ b/tests/env-test.c @@ -24,8 +24,6 @@ * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -#include "config.h" - #undef G_DISABLE_ASSERT #undef G_LOG_DOMAIN @@ -39,7 +37,7 @@ #include -#ifdef HAVE_UNISTD_H +#ifdef G_OS_UNIX #include #endif diff --git a/tests/mapping-test.c b/tests/mapping-test.c index 263dcf9..c21b21f 100644 --- a/tests/mapping-test.c +++ b/tests/mapping-test.c @@ -16,19 +16,18 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ -#include "config.h" - #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include #include "glib.h" #include "gstdio.h" +#ifdef G_OS_UNIX +#include +#endif + static gchar *dir, *filename, *displayname, *childname; static gboolean stop = FALSE; diff --git a/tests/refcount/closures.c b/tests/refcount/closures.c index cc29354..1f702b2 100644 --- a/tests/refcount/closures.c +++ b/tests/refcount/closures.c @@ -16,7 +16,10 @@ * if advised of the possibility of such damage. */ #include + +#ifdef G_OS_UNIX #include +#endif #define TEST_POINTER1 ((gpointer) 47) #define TEST_POINTER2 ((gpointer) 49) diff --git a/tests/refcount/objects.c b/tests/refcount/objects.c index e45db23..2652769 100644 --- a/tests/refcount/objects.c +++ b/tests/refcount/objects.c @@ -1,7 +1,10 @@ -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define G_TYPE_TEST (my_test_get_type ()) #define MY_TEST(test) (G_TYPE_CHECK_INSTANCE_CAST ((test), G_TYPE_TEST, GTest)) #define MY_IS_TEST(test) (G_TYPE_CHECK_INSTANCE_TYPE ((test), G_TYPE_TEST)) diff --git a/tests/refcount/objects2.c b/tests/refcount/objects2.c index 51d7aa7..e19bc67 100644 --- a/tests/refcount/objects2.c +++ b/tests/refcount/objects2.c @@ -1,7 +1,10 @@ -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define G_TYPE_TEST (my_test_get_type ()) #define MY_TEST(test) (G_TYPE_CHECK_INSTANCE_CAST ((test), G_TYPE_TEST, GTest)) #define MY_IS_TEST(test) (G_TYPE_CHECK_INSTANCE_TYPE ((test), G_TYPE_TEST)) diff --git a/tests/refcount/properties.c b/tests/refcount/properties.c index 19121a9..c682342 100644 --- a/tests/refcount/properties.c +++ b/tests/refcount/properties.c @@ -1,7 +1,10 @@ -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define G_TYPE_TEST (my_test_get_type ()) #define MY_TEST(test) (G_TYPE_CHECK_INSTANCE_CAST ((test), G_TYPE_TEST, GTest)) #define MY_IS_TEST(test) (G_TYPE_CHECK_INSTANCE_TYPE ((test), G_TYPE_TEST)) diff --git a/tests/refcount/properties2.c b/tests/refcount/properties2.c index 27e0309..1684bd4 100644 --- a/tests/refcount/properties2.c +++ b/tests/refcount/properties2.c @@ -1,7 +1,10 @@ -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define G_TYPE_TEST (my_test_get_type ()) #define MY_TEST(test) (G_TYPE_CHECK_INSTANCE_CAST ((test), G_TYPE_TEST, GTest)) #define MY_IS_TEST(test) (G_TYPE_CHECK_INSTANCE_TYPE ((test), G_TYPE_TEST)) diff --git a/tests/refcount/signals.c b/tests/refcount/signals.c index 0677834..2a63795 100644 --- a/tests/refcount/signals.c +++ b/tests/refcount/signals.c @@ -1,7 +1,10 @@ -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define G_TYPE_TEST (my_test_get_type ()) #define MY_TEST(test) (G_TYPE_CHECK_INSTANCE_CAST ((test), G_TYPE_TEST, GTest)) #define MY_IS_TEST(test) (G_TYPE_CHECK_INSTANCE_TYPE ((test), G_TYPE_TEST)) diff --git a/tests/slice-concurrent.c b/tests/slice-concurrent.c index 202cfe7..8f8de37 100644 --- a/tests/slice-concurrent.c +++ b/tests/slice-concurrent.c @@ -19,7 +19,9 @@ */ #include #include +#ifdef G_OS_UNIX #include +#endif #define N_THREADS 8 #define N_ALLOCS 50000