fix: Name clash between jni.h and error_func.h

Openttd newly included file error_func.h defines two new macros named
FatalError() and UserError(). FatalError() unfortunatly colides with a
method declared in jni.h

jni.h makes its way into Openttd code by being present at SDL_android.h;

Since knownledge of jni.h is not needed for Openttd code the adopted
solution was to remove jni.h from SDL_android.h and forward declare any
of its usages. Akin to pimpl pattern.
This commit is contained in:
2024-04-07 13:51:20 +01:00
parent c9ce3ced58
commit eadbd04f81

View File

@@ -26,9 +26,16 @@
#include "SDL_video.h"
#include "SDL_screenkeyboard.h"
#include "SDL_audio.h"
#include <jni.h>
#include "begin_code.h"
#if defined(__cplusplus)
struct JavaVM;
#else
struct JNIInvokeInterface;
typedef const struct JNIInvokeInterface* JavaVM;
#endif
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
@@ -148,7 +155,7 @@ extern DECLSPEC void SDLCALL SDL_ANDROID_SetMouseEmulationMode(
int forceHardwareMouse, int showScreenUnderFinger,
int fingerHover, int fingerHoverJitterFilter, int generateSubframeTouchEvents
);
extern DECLSPEC int SDLCALL SDL_ANDROID_GetMouseEmulationMode();
/* Control the System mouse pointer visibility */