mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-31 00:47:39 +00:00
Use the correct return type for SDL_GetAndroidJNIEnv()
This prevents application code from having to cast to JNIEnv everywhere.
This commit is contained in:
parent
3d852da806
commit
2d3fa03d53
4 changed files with 12 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -146,8 +146,8 @@ const char *SDL_GetAndroidInternalStoragePath(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SDL_DECLSPEC void *SDLCALL SDL_GetAndroidJNIEnv(void);
|
||||
void *SDL_GetAndroidJNIEnv(void)
|
||||
SDL_DECLSPEC JNIEnv *SDLCALL SDL_GetAndroidJNIEnv(void);
|
||||
JNIEnv *SDL_GetAndroidJNIEnv(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
|
|
@ -2177,7 +2177,7 @@ bool Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *b
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
void *SDL_GetAndroidJNIEnv(void)
|
||||
JNIEnv *SDL_GetAndroidJNIEnv(void)
|
||||
{
|
||||
return Android_JNI_GetEnv();
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetAndroidCachePath,(void),(),return)
|
|||
SDL_DYNAPI_PROC(const char*,SDL_GetAndroidExternalStoragePath,(void),(),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_GetAndroidExternalStorageState,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_GetAndroidJNIEnv,(void),(),return)
|
||||
SDL_DYNAPI_PROC(JNIEnv*,SDL_GetAndroidJNIEnv,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetAppMetadataProperty,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue