Mercurial > libdvdnav.hg
comparison dvdnav_internal.h @ 370:d80a041928be src
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)
author | nicodvb |
---|---|
date | Thu, 05 Jun 2008 08:45:35 +0000 |
parents | ce4230602517 |
children | 90ca650854e0 |
comparison
equal
deleted
inserted
replaced
369:1ab4b25afca3 | 370:d80a041928be |
---|---|
37 #define pthread_mutex_init(a, b) InitializeCriticalSection(a) | 37 #define pthread_mutex_init(a, b) InitializeCriticalSection(a) |
38 #define pthread_mutex_lock(a) EnterCriticalSection(a) | 38 #define pthread_mutex_lock(a) EnterCriticalSection(a) |
39 #define pthread_mutex_unlock(a) LeaveCriticalSection(a) | 39 #define pthread_mutex_unlock(a) LeaveCriticalSection(a) |
40 #define pthread_mutex_destroy(a) | 40 #define pthread_mutex_destroy(a) |
41 | 41 |
42 #ifndef HAVE_GETTIMEOFDAY | |
42 /* replacement gettimeofday implementation */ | 43 /* replacement gettimeofday implementation */ |
43 #include <sys/timeb.h> | 44 #include <sys/timeb.h> |
44 static inline int _private_gettimeofday( struct timeval *tv, void *tz ) | 45 static inline int _private_gettimeofday( struct timeval *tv, void *tz ) |
45 { | 46 { |
46 struct timeb t; | 47 struct timeb t; |
48 tv->tv_sec = t.time; | 49 tv->tv_sec = t.time; |
49 tv->tv_usec = t.millitm * 1000; | 50 tv->tv_usec = t.millitm * 1000; |
50 return 0; | 51 return 0; |
51 } | 52 } |
52 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) | 53 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) |
54 #endif | |
55 | |
53 #include <io.h> /* read() */ | 56 #include <io.h> /* read() */ |
54 #define lseek64 _lseeki64 | 57 #define lseek64 _lseeki64 |
55 | 58 |
56 #else | 59 #else |
57 | 60 |