comparison dvd_reader.c @ 6:e5663591d13c src

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)
author nicodvb
date Thu, 05 Jun 2008 08:52:00 +0000
parents fdbae45c30fc
children a481060ec57b
comparison
equal deleted inserted replaced
5:5f0f78aac041 6:e5663591d13c
32 #include <limits.h> 32 #include <limits.h>
33 #include <dirent.h> 33 #include <dirent.h>
34 34
35 /* misc win32 helpers */ 35 /* misc win32 helpers */
36 #ifdef WIN32 36 #ifdef WIN32
37 #ifndef HAVE_GETTIMEOFDAY
37 /* replacement gettimeofday implementation */ 38 /* replacement gettimeofday implementation */
38 #include <sys/timeb.h> 39 #include <sys/timeb.h>
39 static inline int _private_gettimeofday( struct timeval *tv, void *tz ) 40 static inline int _private_gettimeofday( struct timeval *tv, void *tz )
40 { 41 {
41 struct timeb t; 42 struct timeb t;
43 tv->tv_sec = t.time; 44 tv->tv_sec = t.time;
44 tv->tv_usec = t.millitm * 1000; 45 tv->tv_usec = t.millitm * 1000;
45 return 0; 46 return 0;
46 } 47 }
47 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) 48 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ))
49 #endif
48 #include <io.h> /* read() */ 50 #include <io.h> /* read() */
49 #define lseek64 _lseeki64 51 #define lseek64 _lseeki64
50 #endif 52 #endif
51 53
52 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__) 54 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)