mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-30 00:17:40 +00:00
Revert "Use the correct return type for SDL_GetAndroidJNIEnv()"
This reverts commit 2d3fa03d53
.
Different JDK implementations define JNIEnv differently for C++, so we can't provide the definition here.
Fixes:
/usr/lib/jvm/temurin-11-jdk-amd64/include/jni.h:195:17: error: conflicting declaration ‘typedef struct JNIEnv_ JNIEnv’
/home/runner/work/sdlwiki/sdlwiki/.github/../external/SDL3/include/SDL3/SDL_system.h:266:24: note: previous declaration as ‘typedef struct _JNIEnv JNIEnv’
This commit is contained in:
parent
ffb1d9e4b4
commit
153f90a725
5 changed files with 11 additions and 18 deletions
|
@ -261,13 +261,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
|
||||||
/*
|
/*
|
||||||
* Platform specific functions for Android
|
* Platform specific functions for Android
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
typedef struct _JNIEnv JNIEnv;
|
|
||||||
#else
|
|
||||||
typedef const struct JNINativeInterface* JNIEnv;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_ANDROID
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -290,7 +283,7 @@ typedef const struct JNINativeInterface* JNIEnv;
|
||||||
*
|
*
|
||||||
* \sa SDL_GetAndroidActivity
|
* \sa SDL_GetAndroidActivity
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC JNIEnv * SDLCALL SDL_GetAndroidJNIEnv(void);
|
extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the Java instance of the Android activity class.
|
* Retrieve the Java instance of the Android activity class.
|
||||||
|
|
|
@ -146,8 +146,8 @@ const char *SDL_GetAndroidInternalStoragePath(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_DECLSPEC JNIEnv *SDLCALL SDL_GetAndroidJNIEnv(void);
|
SDL_DECLSPEC void *SDLCALL SDL_GetAndroidJNIEnv(void);
|
||||||
JNIEnv *SDL_GetAndroidJNIEnv(void)
|
void *SDL_GetAndroidJNIEnv(void)
|
||||||
{
|
{
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -2177,7 +2177,7 @@ bool Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *b
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JNIEnv *SDL_GetAndroidJNIEnv(void)
|
void *SDL_GetAndroidJNIEnv(void)
|
||||||
{
|
{
|
||||||
return Android_JNI_GetEnv();
|
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(const char*,SDL_GetAndroidExternalStoragePath,(void),(),return)
|
||||||
SDL_DYNAPI_PROC(Uint32,SDL_GetAndroidExternalStorageState,(void),(),return)
|
SDL_DYNAPI_PROC(Uint32,SDL_GetAndroidExternalStorageState,(void),(),return)
|
||||||
SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return)
|
SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return)
|
||||||
SDL_DYNAPI_PROC(JNIEnv*,SDL_GetAndroidJNIEnv,(void),(),return)
|
SDL_DYNAPI_PROC(void*,SDL_GetAndroidJNIEnv,(void),(),return)
|
||||||
SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(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(const char*,SDL_GetAppMetadataProperty,(const char *a),(a),return)
|
||||||
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return)
|
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return)
|
||||||
|
|
|
@ -492,7 +492,7 @@ public:
|
||||||
|
|
||||||
bool BOpen()
|
bool BOpen()
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
if ( !g_HIDDeviceManagerCallbackHandler )
|
if ( !g_HIDDeviceManagerCallbackHandler )
|
||||||
{
|
{
|
||||||
|
@ -624,7 +624,7 @@ public:
|
||||||
|
|
||||||
int WriteReport( const unsigned char *pData, size_t nDataLen, bool bFeature )
|
int WriteReport( const unsigned char *pData, size_t nDataLen, bool bFeature )
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
if ( !g_HIDDeviceManagerCallbackHandler )
|
if ( !g_HIDDeviceManagerCallbackHandler )
|
||||||
{
|
{
|
||||||
|
@ -654,7 +654,7 @@ public:
|
||||||
|
|
||||||
int ReadReport( unsigned char *pData, size_t nDataLen, bool bFeature )
|
int ReadReport( unsigned char *pData, size_t nDataLen, bool bFeature )
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
if ( !g_HIDDeviceManagerCallbackHandler )
|
if ( !g_HIDDeviceManagerCallbackHandler )
|
||||||
{
|
{
|
||||||
|
@ -727,7 +727,7 @@ public:
|
||||||
|
|
||||||
void Close( bool bDeleteDevice )
|
void Close( bool bDeleteDevice )
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
if ( g_HIDDeviceManagerCallbackHandler )
|
if ( g_HIDDeviceManagerCallbackHandler )
|
||||||
{
|
{
|
||||||
|
@ -1022,7 +1022,7 @@ static void SDLCALL RequestBluetoothPermissionCallback( void *userdata, const ch
|
||||||
|
|
||||||
if ( granted && g_HIDDeviceManagerCallbackHandler )
|
if ( granted && g_HIDDeviceManagerCallbackHandler )
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
env->CallBooleanMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerInitialize, false, true );
|
env->CallBooleanMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerInitialize, false, true );
|
||||||
}
|
}
|
||||||
|
@ -1035,7 +1035,7 @@ int hid_init(void)
|
||||||
// HIDAPI doesn't work well with Android < 4.3
|
// HIDAPI doesn't work well with Android < 4.3
|
||||||
if ( SDL_GetAndroidSDKVersion() >= 18 )
|
if ( SDL_GetAndroidSDKVersion() >= 18 )
|
||||||
{
|
{
|
||||||
JNIEnv *env = SDL_GetAndroidJNIEnv();
|
JNIEnv *env = (JNIEnv *)SDL_GetAndroidJNIEnv();
|
||||||
|
|
||||||
env->CallBooleanMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerInitialize, true, false );
|
env->CallBooleanMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerInitialize, true, false );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue