From 40e9416c6ca44f501afbf22aa4facaa8fa505594 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 9 Feb 2018 13:33:03 -0500 Subject: [PATCH] use 64-bit ftell on Windows where available --- libretro-common/vfs/vfs_implementation.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 14eb11afd0..b35f8e8b12 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -75,6 +75,12 @@ #endif +#if defined(_WIN32) && !defined(_XBOX) +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#define ATLEAST_VC2005 +#endif +#endif + #ifdef RARCH_INTERNAL #ifndef VFS_FRONTEND #define VFS_FRONTEND @@ -373,7 +379,12 @@ int64_t retro_vfs_file_tell_impl(libretro_vfs_implementation_file *stream) return -1; if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) +/* VC2005 and up have a special 64-bit ftell */ +#ifdef ATLEAST_VC2005 + return _ftelli64(stream->fp); +#else return ftell(stream->fp); +#endif #ifdef HAVE_MMAP /* Need to check stream->mapped because this function