diff --git a/Makefile b/Makefile index 9a33100f44..a9e72cb4b7 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ endif OBJ := LIBS := -DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL +DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"' ifneq ($(findstring BSD,$(OS)),) diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 948e9a337b..0e96f2957f 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -120,7 +120,12 @@ int64_t retro_vfs_file_seek_internal(libretro_vfs_implementation_file *stream, i goto error; if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) - return fseek(stream->fp, (long)offset, whence); +/* VC2005 and up have a special 64-bit fseek */ +#ifdef ATLEAST_VC2005 + return _fseeki64(stream->fp, offset, whence); +#else + return fseeko(stream->fp, (off_t)offset, whence); +#endif #ifdef HAVE_MMAP /* Need to check stream->mapped because this function is