From 9a9fdf0b414cfd77d1fbb0121bbd888bfb011586 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sat, 23 Feb 2013 20:12:14 -0500 Subject: [PATCH] WinRT: build fixes --- include/SDL_config_windowsrt.h | 3 ++- src/file/SDL_rwops.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/SDL_config_windowsrt.h b/include/SDL_config_windowsrt.h index 98f01579e..a21777451 100644 --- a/include/SDL_config_windowsrt.h +++ b/include/SDL_config_windowsrt.h @@ -104,7 +104,7 @@ typedef unsigned int uintptr_t; #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 -#define HAVE_ITOA 1 +//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead //#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead //#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead #define HAVE_STRTOL 1 @@ -134,6 +134,7 @@ typedef unsigned int uintptr_t; #define HAVE_SIN 1 #define HAVE_SINF 1 #define HAVE_SQRT 1 +#define HAVE__FSEEKI64 1 /* Enable various audio drivers */ #define SDL_AUDIO_DRIVER_XAUDIO2 1 diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 1aab8e987..e521588db 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -325,6 +325,10 @@ stdio_seek(SDL_RWops * context, Sint64 offset, int whence) if (fseeko(context->hidden.stdio.fp, (off_t)offset, whence) == 0) { return ftello(context->hidden.stdio.fp); } +#elif defined(HAVE__FSEEKI64) + if (_fseeki64(context->hidden.stdio.fp, offset, whence) == 0) { + return _ftelli64(context->hidden.stdio.fp); + } #else if (fseek(context->hidden.stdio.fp, offset, whence) == 0) { return (ftell(context->hidden.stdio.fp));