SDL: Fixed build errors after SDL_IOWhence change

From 3e018517c38f4db0de7239b87939e47c20d09ae1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 9 Jun 2024 08:26:29 -0700
Subject: [PATCH] Fixed build errors after SDL_IOWhence change

---
 src/core/android/SDL_android.c | 4 ++--
 src/core/android/SDL_android.h | 2 +-
 test/testautomation_iostream.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 2cffd3b5d5838..11ec189e3018c 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -2040,9 +2040,9 @@ Sint64 Android_JNI_FileSize(void *userdata)
     return (Sint64) AAsset_getLength64((AAsset *)userdata);
 }
 
-Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, int whence)
+Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence)
 {
-    return (Sint64) AAsset_seek64((AAsset *)userdata, offset, whence);
+    return (Sint64) AAsset_seek64((AAsset *)userdata, offset, (int)whence);
 }
 
 int Android_JNI_FileClose(void *userdata)
diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h
index 069199e9910a6..80b61cc33d955 100644
--- a/src/core/android/SDL_android.h
+++ b/src/core/android/SDL_android.h
@@ -68,7 +68,7 @@ extern SDL_bool Android_IsChromebook(void);
 
 int Android_JNI_FileOpen(void **puserdata, const char *fileName, const char *mode);
 Sint64 Android_JNI_FileSize(void *userdata);
-Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, int whence);
+Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence);
 size_t Android_JNI_FileRead(void *userdata, void *buffer, size_t size, SDL_IOStatus *status);
 size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status);
 int Android_JNI_FileClose(void *userdata);
diff --git a/test/testautomation_iostream.c b/test/testautomation_iostream.c
index b6a66ec2d6b5f..05595236e7cce 100644
--- a/test/testautomation_iostream.c
+++ b/test/testautomation_iostream.c
@@ -190,7 +190,7 @@ static void testGenericIOStreamValidations(SDL_IOStream *rw, SDL_bool write)
         (int)i);
 
     /* Invalid whence seek */
-    i = SDL_SeekIO(rw, 0, 999);
+    i = SDL_SeekIO(rw, 0, (SDL_IOWhence)999);
     SDLTest_AssertPass("Call to SDL_SeekIO(...,0,invalid_whence) succeeded");
     SDLTest_AssertCheck(
         i == (Sint64)(-1),