22 */ |
22 */ |
23 |
23 |
24 #include <stdio.h> /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */ |
24 #include <stdio.h> /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */ |
25 #include "physfsrwops.h" |
25 #include "physfsrwops.h" |
26 |
26 |
27 #ifdef WIN32_VCPKG |
|
28 #define SDLCALL __cdecl |
|
29 #endif |
|
30 |
|
31 /* SDL's RWOPS interface changed a little in SDL 1.3... */ |
27 /* SDL's RWOPS interface changed a little in SDL 1.3... */ |
32 #if defined(SDL_VERSION_ATLEAST) |
28 #if defined(SDL_VERSION_ATLEAST) |
33 #if SDL_VERSION_ATLEAST(1, 3, 0) |
29 #if SDL_VERSION_ATLEAST(1, 3, 0) |
34 #define TARGET_SDL13 1 |
30 #define TARGET_SDL13 1 |
35 #endif |
31 #endif |
36 #endif |
32 #endif |
37 |
33 |
38 #if TARGET_SDL13 |
34 #if TARGET_SDL13 |
39 static SDLCALL Sint64 physfsrwops_size(struct SDL_RWops *rw) |
35 static Sint64 SDLCALL physfsrwops_size(struct SDL_RWops *rw) |
40 { |
36 { |
41 PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1; |
37 PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1; |
42 return PHYSFS_fileLength(handle); |
38 return PHYSFS_fileLength(handle); |
43 } |
39 } |
44 #endif |
40 #endif |
45 |
41 |
46 #if TARGET_SDL13 |
42 #if TARGET_SDL13 |
47 static SDLCALL Sint64 physfsrwops_seek(struct SDL_RWops *rw, Sint64 offset, int whence) |
43 static Sint64 SDLCALL physfsrwops_seek(struct SDL_RWops *rw, Sint64 offset, int whence) |
48 #else |
44 #else |
49 static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) |
45 static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) |
50 #endif |
46 #endif |
51 { |
47 { |
52 PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1; |
48 PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1; |