glib/tests/thread.c: Add config guards
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 17 Oct 2011 09:18:20 +0000 (17:18 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 17 Oct 2011 09:18:20 +0000 (17:18 +0800)
Not all systems come with unistd.h and sys/time.h, so use config guards
on them so that they are only included when available.

glib/tests/thread.c

index 2c7c741..a614c27 100644 (file)
 
 #include <config.h>
 
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <sys/types.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include <glib.h>