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 committed 2024-10-17 12:02:24 -07:00
1 parent 3d852da806
commit 2d3fa03d53
4 files changed
+12 -5

No files matched your search

+8 -1
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.