From 6fdcc7ddb2be5a978482fe8e919064fc85745d0a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 25 Nov 2007 22:47:39 +0000 Subject: [PATCH] Add conditionals for non-Unix. Just g_error() unless G_OS_UNIX for now. 2007-11-25 Tor Lillqvist * glib/gtestutils.c: Add conditionals for non-Unix. Just g_error() unless G_OS_UNIX for now. svn path=/trunk/; revision=5936 --- ChangeLog | 3 ++- glib/Makefile.am | 9 ++------- glib/gtestutils.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bb4ff7..0a5087c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2007-11-25 Tor Lillqvist - * glib/Makefile.am: Build gtestutils etc on OS_UNIX only. + * glib/gtestutils.c: Add conditionals for non-Unix. Just g_error() + unless G_OS_UNIX for now. 2007-11-25 Matthias Clasen diff --git a/glib/Makefile.am b/glib/Makefile.am index 789ebdf..a87a383 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -19,12 +19,7 @@ gregex_c = gregex_h = endif -if OS_UNIX -gtestutils_c = gtestutils.c -tests_subdir = tests -endif - -SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . $(tests_subdir) +SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests DIST_SUBDIRS = libcharset gnulib pcre update-pcre @@ -145,7 +140,7 @@ libglib_2_0_la_SOURCES = \ gstdio.c \ gstrfuncs.c \ gstring.c \ - $(gtestutils_c) \ + gtestutils.c \ gthread.c \ gthreadprivate.h \ gthreadpool.c \ diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 4543017..8a55d45 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -21,11 +21,15 @@ #include "gtestutils.h" #include "galias.h" #include +#ifdef G_OS_UNIX #include #include +#endif #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #ifdef HAVE_SYS_SELECT_H @@ -1130,6 +1134,7 @@ g_strcmp0 (const char *str1, return strcmp (str1, str2); } +#ifdef G_OS_UNIX static int /* 0 on success */ kill_child (int pid, int *status, @@ -1175,6 +1180,7 @@ kill_child (int pid, while (wr < 0 && errno == EINTR); return wr; } +#endif static inline int g_string_must_read (GString *gstring, @@ -1297,6 +1303,7 @@ gboolean g_test_trap_fork (guint64 usec_timeout, GTestTrapFlags test_trap_flags) { +#ifdef G_OS_UNIX int stdout_pipe[2] = { -1, -1 }; int stderr_pipe[2] = { -1, -1 }; int stdtst_pipe[2] = { -1, -1 }; @@ -1424,6 +1431,9 @@ g_test_trap_fork (guint64 usec_timeout, test_trap_last_stderr = g_string_free (serr, FALSE); return FALSE; } +#else + g_error ("Not implemented: g_test_trap_fork"); +#endif } /** -- 2.7.4