Merge pull request #6302 from bparker06/fseek

use 64-bit file offsets/seeking on windows
This commit is contained in:
Twinaphex 2018-02-14 07:29:34 +01:00 committed by GitHub
commit be87075618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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)),)

View File

@ -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