Commit 2d5ba414 authored by Rafaël Carré's avatar Rafaël Carré

gettimeofday() doesn't exist in windows, but recent mingw32 runtime

include a replacement that clashes with mingw32's one.
This patch will check for it in configure.ac and define the private
function only if gettimeofday() is not defined.



parent fa6af23c
......@@ -129,6 +129,17 @@ AC_TYPE_SIZE_T
dnl AC_CHECK_TYPES([ptrdiff_t])
AC_C_BIGENDIAN
dnl -------------------------------------------------------------
dnl Check for basic *nix fonction that we may emulate on windows.
dnl -------------------------------------------------------------
case $host in
*mingw32* | *cygwin*)
AC_CHECK_FUNCS(gettimeofday)
;;
*)
;;
esac
dnl ---------------------------------------------
dnl dynamic linker
dnl ---------------------------------------------
......
......@@ -34,6 +34,7 @@
/* misc win32 helpers */
#ifdef WIN32
#ifndef HAVE_GETTIMEOFDAY
/* replacement gettimeofday implementation */
#include <sys/timeb.h>
static inline int _private_gettimeofday( struct timeval *tv, void *tz )
......@@ -45,6 +46,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
return 0;
}
#define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ))
#endif
#include <io.h> /* read() */
#define lseek64 _lseeki64
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment