# HG changeset patch # User jcdutton # Date 1075555660 0 # Node ID 065a2835ba90a784cf6ab5301f68fec8d9916d27 # Parent 8b5edf44e384b88e757fcb2472f857778984f85d Patch to compile with mingw32 from: - Gildas Bazin diff -r 8b5edf44e384 -r 065a2835ba90 dvdnav.c --- a/dvdnav.c Wed Jan 21 23:11:05 2004 +0000 +++ b/dvdnav.c Sat Jan 31 13:27:40 2004 +0000 @@ -29,12 +29,9 @@ #define LOG_DEBUG */ -#include #include "dvdnav_internal.h" #include "read_cache.h" -#include "nav_read.h" - #include #include #include diff -r 8b5edf44e384 -r 065a2835ba90 dvdnav_internal.h --- 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 #include #include + +#ifdef WIN32 +/* pthread_mutex_* wrapper for win32 */ +#include +#include +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 +#endif -#include "dvd_reader.h" -#include "ifo_read.h" -#include "ifo_types.h" +/* misc win32 helpers */ +#ifdef WIN32 +/* replacement gettimeofday implementation */ +#include +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 /* read() */ +#define lseek64 _lseeki64 +#endif /* Uncomment for VM command tracing */ /* #define TRACE */ diff -r 8b5edf44e384 -r 065a2835ba90 read_cache.c --- a/read_cache.c Wed Jan 21 23:11:05 2004 +0000 +++ b/read_cache.c Sat Jan 31 13:27:40 2004 +0000 @@ -31,8 +31,8 @@ #endif #include "dvdnav.h" +#include "dvdnav_internal.h" #include "read_cache.h" -#include #include #include