Use the correct return type for SDL_GetAndroidJNIEnv()

This prevents application code from having to cast to JNIEnv everywhere.
This commit is contained in:
Sam Lantinga
2024-10-17 09:23:52 -07:00
parent 3d852da806
commit 2d3fa03d53
4 changed files with 12 additions and 5 deletions

View File

@@ -261,6 +261,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
/*
* Platform specific functions for Android
*/
#if defined(__cplusplus)
typedef struct _JNIEnv JNIEnv;
#else
typedef const struct JNINativeInterface* JNIEnv;
#endif
#ifdef SDL_PLATFORM_ANDROID
/**
@@ -283,7 +290,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
*
* \sa SDL_GetAndroidActivity
*/
extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void);
extern SDL_DECLSPEC JNIEnv * SDLCALL SDL_GetAndroidJNIEnv(void);
/**
* Retrieve the Java instance of the Android activity class.