[DVDnav-discuss] r1062 - in trunk/libdvdnav: configure.ac src/dvdnav_internal.h

nicodvb subversion at mplayerhq.hu
Thu Jun 5 10:45:35 CEST 2008


Author: nicodvb
Date: Thu Jun  5 10:45:35 2008
New Revision: 1062

Log:
gettimeofday() doesn't exist on windows, but recent mingw32 runtime
include a replacement. The dvdnav replacement 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/libdvdnav/configure.ac
   trunk/libdvdnav/src/dvdnav_internal.h

Modified: trunk/libdvdnav/configure.ac
==============================================================================
--- trunk/libdvdnav/configure.ac	(original)
+++ trunk/libdvdnav/configure.ac	Thu Jun  5 10:45:35 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 threads
 dnl ---------------------------------------------

Modified: trunk/libdvdnav/src/dvdnav_internal.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav_internal.h	(original)
+++ trunk/libdvdnav/src/dvdnav_internal.h	Thu Jun  5 10:45:35 2008
@@ -39,6 +39,7 @@ typedef CRITICAL_SECTION pthread_mutex_t
 #define pthread_mutex_unlock(a)  LeaveCriticalSection(a)
 #define pthread_mutex_destroy(a)
 
+#ifndef HAVE_GETTIMEOFDAY
 /* replacement gettimeofday implementation */
 #include <sys/timeb.h>
 static inline int _private_gettimeofday( struct timeval *tv, void *tz )
@@ -50,6 +51,8 @@ static inline int _private_gettimeofday(
   return 0;
 }
 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ))
+#endif
+
 #include <io.h> /* read() */
 #define lseek64 _lseeki64
 



More information about the DVDnav-discuss mailing list