summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/dvd_reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/libdvdnav/dvd_reader.c')
-rw-r--r--src/input/libdvdnav/dvd_reader.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c
index b173a130e..185143604 100644
--- a/src/input/libdvdnav/dvd_reader.c
+++ b/src/input/libdvdnav/dvd_reader.c
@@ -31,6 +31,22 @@
#include <unistd.h>
#include <limits.h>
#include <dirent.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
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
#define SYS_BSD 1
@@ -52,10 +68,6 @@
#define DEFAULT_UDF_CACHE_LEVEL 1
-#ifdef _MSC_VER
-#define fchdir chdir
-#endif
-
struct dvd_reader_s {
/* Basic information. */
int isImageFile;
@@ -387,6 +399,9 @@ dvd_reader_t *DVDOpen( const char *ppath )
return 0;
}
+#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
+ /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
+
/* Resolve any symlinks and get the absolut dir name. */
{
char *new_path;
@@ -403,7 +418,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
}
}
}
-
+#endif
/**
* If we're being asked to open a directory, check if that directory
* is the mountpoint for a DVD-ROM which we can use instead.