From d54280cbf8b61c32dec35d8b9858bda78e17495c Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Sat, 25 Feb 2012 05:34:24 +0000 Subject: [PATCH] Checking for "gettimeofday" per e-mail from John Tsiombikas dated 2/23/12 at 9:29 AM git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1078 7f0cb862-5218-0410-a997-914c9d46530a --- CMakeLists.txt | 2 ++ config.h.in | 1 + src/x11/freeglut_main_x11.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c80756..95eee54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,7 @@ if(UNIX) ENDIF() INCLUDE(CheckIncludeFiles) +INCLUDE(CheckFunctionExists) CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) @@ -116,6 +117,7 @@ CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) CHECK_INCLUDE_FILES(errno.h HAVE_ERRNO_H) CHECK_INCLUDE_FILES(usbhid.h HAVE_USBHID_H) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) # The generated config.h is placed in the project's build directory, just to # ensure that all CMake-generated files are kept away from the main source tree. diff --git a/config.h.in b/config.h.in index e85a56d..fe14591 100644 --- a/config.h.in +++ b/config.h.in @@ -9,3 +9,4 @@ #cmakedefine HAVE_FCNTL_H #cmakedefine HAVE_ERRNO_H #cmakedefine HAVE_USBHID_H +#cmakedefine HAVE_GETTIMEOFDAY \ No newline at end of file diff --git a/src/x11/freeglut_main_x11.c b/src/x11/freeglut_main_x11.c index eeb1288..33553e3 100644 --- a/src/x11/freeglut_main_x11.c +++ b/src/x11/freeglut_main_x11.c @@ -91,7 +91,7 @@ void fgPlatformDisplayWindow ( SFG_Window *window ) unsigned long fgPlatformSystemTime ( void ) { -#if TARGET_HOST_SOLARIS || HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY struct timeval now; gettimeofday( &now, NULL ); return now.tv_usec/1000 + now.tv_sec*1000; -- 1.7.10.4