Mercurial > libdvdnav.hg
diff dvdnav_internal.h @ 230:065a2835ba90 src
Patch to compile with mingw32 from: -
Gildas Bazin <gbazin AT altern.org>
author | jcdutton |
---|---|
date | Sat, 31 Jan 2004 13:27:40 +0000 |
parents | eb503714e1c2 |
children | eaa775ba1306 |
line wrap: on
line diff
--- a/dvdnav_internal.h Wed Jan 21 23:11:05 2004 +0000 +++ b/dvdnav_internal.h Sat Jan 31 13:27:40 2004 +0000 @@ -33,11 +33,35 @@ #include <unistd.h> #include <limits.h> #include <string.h> + +#ifdef WIN32 +/* pthread_mutex_* wrapper for win32 */ +#include <windows.h> +#include <process.h> +typedef CRITICAL_SECTION pthread_mutex_t; +#define pthread_mutex_init(a, b) InitializeCriticalSection(a) +#define pthread_mutex_lock(a) EnterCriticalSection(a) +#define pthread_mutex_unlock(a) LeaveCriticalSection(a) +#define pthread_mutex_destroy(a) +#else #include <pthread.h> +#endif -#include "dvd_reader.h" -#include "ifo_read.h" -#include "ifo_types.h" +/* misc win32 helpers */ +#ifdef WIN32 +/* replacement gettimeofday implementation */ +#include <sys/timeb.h> +static inline int gettimeofday( struct timeval *tv, void *tz ) +{ + struct timeb t; + ftime( &t ); + tv->tv_sec = t.time; + tv->tv_usec = t.millitm * 1000; + return 0; +} +#include <io.h> /* read() */ +#define lseek64 _lseeki64 +#endif /* Uncomment for VM command tracing */ /* #define TRACE */