#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);
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;
}