X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fphysfs%2Fphysfs_sdl.cpp;fp=src%2Fphysfs%2Fphysfs_sdl.cpp;h=2ad5b36ac0f760bdd5e504379ffb6c1665971187;hb=59f8db0e91a23a90aef922b92c2d6143290de523;hp=82c78699787fab511325d817812eb87b9454ecee;hpb=32e52a23d8bf13c7dfe2e6761c3e696d3780e431;p=supertux.git diff --git a/src/physfs/physfs_sdl.cpp b/src/physfs/physfs_sdl.cpp index 82c786997..2ad5b36ac 100644 --- a/src/physfs/physfs_sdl.cpp +++ b/src/physfs/physfs_sdl.cpp @@ -23,10 +23,19 @@ #include "util/log.hpp" -static int funcSeek(struct SDL_RWops* context, int offset, int whence) +#if SDL_VERSION_ATLEAST(1,3,0) +typedef size_t st_read_t; +typedef long st_seek_t; +#else +typedef int st_read_t; +typedef int st_seek_t; +#endif + +static st_seek_t funcSeek(struct SDL_RWops* context, + st_seek_t offset, int whence) { PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1; - int res; + st_seek_t res; switch(whence) { case SEEK_SET: res = PHYSFS_seek(file, offset); @@ -47,14 +56,15 @@ static int funcSeek(struct SDL_RWops* context, int offset, int whence) return -1; } - return (int) PHYSFS_tell(file); + return (st_seek_t) PHYSFS_tell(file); } -static int funcRead(struct SDL_RWops* context, void* ptr, int size, int maxnum) +static st_read_t funcRead(struct SDL_RWops* context, void* ptr, + st_read_t size, st_read_t maxnum) { PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1; - int res = PHYSFS_read(file, ptr, size, maxnum); + st_read_t res = PHYSFS_read(file, ptr, size, maxnum); return res; }