Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/file/SDL_rwops.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,21 @@ stdio_size(SDL_RWops * context)
static Sint64 SDLCALL
stdio_seek(SDL_RWops * context, Sint64 offset, int whence)
{
// XXX EMSCRIPTEN this seems like an SDL bug?
switch (whence) {
case RW_SEEK_SET:
whence = SEEK_SET;
break;
case RW_SEEK_CUR:
whence = SEEK_CUR;
break;
case RW_SEEK_END:
whence = SEEK_END;
break;
default:
return SDL_SetError("stdio_seek: Unknown value for 'whence'");
}

#if defined(FSEEK_OFF_MIN) && defined(FSEEK_OFF_MAX)
if (offset < (Sint64)(FSEEK_OFF_MIN) || offset > (Sint64)(FSEEK_OFF_MAX)) {
return SDL_SetError("Seek offset out of range");
Expand Down