Fixed <sys/time.h> / <time.h> handling as suggested by the autoconf
authorSven Panne <sven.panne@aedion.de>
Mon, 3 Jan 2005 10:24:15 +0000 (10:24 +0000)
committerSven Panne <sven.panne@aedion.de>
Mon, 3 Jan 2005 10:24:15 +0000 (10:24 +0000)
docs.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@548 7f0cb862-5218-0410-a997-914c9d46530a

configure.ac
progs/demos/Lorenz/lorenz.c
src/freeglut_internal.h
src/freeglut_main.c

index 3d00d8b..9d5bc07 100644 (file)
@@ -23,7 +23,8 @@ AC_SUBST([LIBXXF86VM])
 
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glx.h])
+AC_CHECK_HEADERS([sys/time.h GL/gl.h GL/glu.h GL/glx.h])
+AC_HEADER_TIME
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $X_CFLAGS"
index be32c77..f2de979 100644 (file)
@@ -31,7 +31,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include <time.h>
 #include <GL/freeglut.h>
 #ifdef WIN32
 /* DUMP MEMORY LEAKS */
index b9cc632..effb2e0 100644 (file)
 #include <stdarg.h>
 #if TARGET_HOST_UNIX_X11
 #include <unistd.h>
-#include <sys/time.h>
+#    if TIME_WITH_SYS_TIME
+#        include <sys/time.h>
+#        include <time.h>
+#    else
+#        if HAVE_SYS_TIME_H
+#            include <sys/time.h>
+#        else
+#            include <time.h>
+#        endif
+#    endif
 #endif
 
 /* The system-dependant include files should go here: */
index 134ffb3..a62ffc0 100644 (file)
@@ -31,7 +31,6 @@
 #include <limits.h>
 #if TARGET_HOST_UNIX_X11
 #include <sys/types.h>
-#include <sys/time.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/stat.h>