[Liboil-commit] configure.ac liboil/liboilcpu.c liboil/liboilprofile.c

David Schleef ds at kemper.freedesktop.org
Tue Mar 4 13:52:30 PST 2008


 configure.ac           |    2 ++
 liboil/liboilcpu.c     |    4 ++++
 liboil/liboilprofile.c |    2 ++
 3 files changed, 8 insertions(+)

New commits:
commit 3d5f675428c648b2a4323cbeb33cff8b851de2a1
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Tue Mar 4 13:54:45 2008 -0800

    Add tests for unistd.h and sys/time.h.  Use.

diff --git a/configure.ac b/configure.ac
index 352c49b..b4c6902 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,6 +134,8 @@ AC_CHECK_HEADER(ieee754.h,
   AC_DEFINE(HAVE_IEEE754_H, 1, [Define if ieee754.h exists]))
 
 AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS([unistd.h])
 
 AC_CHECK_FUNCS([gettimeofday])
 AC_CHECK_FUNCS([sigaction])
diff --git a/liboil/liboilcpu.c b/liboil/liboilcpu.c
index e9ebb84..cada253 100644
--- a/liboil/liboilcpu.c
+++ b/liboil/liboilcpu.c
@@ -34,14 +34,18 @@
 #include <liboil/liboilfault.h>
 #include <liboil/liboilutils.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <setjmp.h>
 #include <signal.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <time.h>
 
 #if defined(__FreeBSD__)
diff --git a/liboil/liboilprofile.c b/liboil/liboilprofile.c
index f84fcb2..4f5d139 100644
--- a/liboil/liboilprofile.c
+++ b/liboil/liboilprofile.c
@@ -32,7 +32,9 @@
 #include <liboil/liboilprofile.h>
 #include <liboil/liboildebug.h>
 
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <time.h>
 #include <string.h>
 #include <math.h>


More information about the Liboil-commit mailing list