[DVDnav-discuss] r1063 - in trunk/libdvdread: configure.ac src/dvd_reader.c

nicodvb subversion at mplayerhq.hu
Thu Jun 5 10:52:00 CEST 2008


Author: nicodvb
Date: Thu Jun  5 10:52:00 2008
New Revision: 1063

Log:
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.
Patch by Rafael Carré (funman videolan org)



Modified:
   trunk/libdvdread/configure.ac
   trunk/libdvdread/src/dvd_reader.c

Modified: trunk/libdvdread/configure.ac
==============================================================================
--- trunk/libdvdread/configure.ac	(original)
+++ trunk/libdvdread/configure.ac	Thu Jun  5 10:52:00 2008
@@ -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 ---------------------------------------------

Modified: trunk/libdvdread/src/dvd_reader.c
==============================================================================
--- trunk/libdvdread/src/dvd_reader.c	(original)
+++ trunk/libdvdread/src/dvd_reader.c	Thu Jun  5 10:52:00 2008
@@ -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(
   return 0;
 }
 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ))
+#endif
 #include <io.h> /* read() */
 #define lseek64 _lseeki64
 #endif



More information about the DVDnav-discuss mailing list