From 994ec81432c8530ebd95c347203c00f2f86cb6ce Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Tue, 15 Jun 2021 22:02:53 +0300 Subject: [PATCH] android: export jni functions --- src/game/Doom2DF.lpr | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index 74354e0..5911994 100644 --- a/src/game/Doom2DF.lpr +++ b/src/game/Doom2DF.lpr @@ -24,7 +24,7 @@ uses {$IFDEF ANDROID} - ctypes, + ctypes, jni, {$ENDIF} {$IFDEF UNIX} cthreads, BaseUnix, @@ -1042,7 +1042,19 @@ end; result := 0 end; - exports SDL_main; + function JNI_OnLoad (vm: PJavaVM; reserved: pointer): JInt; cdecl; + begin + result:= JNI_VERSION_1_6; + end; + + procedure JNI_OnUnload(vm: PJavaVM; reserved: pointer); cdecl; + begin + end; + + // DONT REMOVE JNI FUNCTIONS. SPECIAL HANDLING BY FPC. + exports SDL_main name 'SDL_main'; + exports JNI_OnLoad name 'JNI_OnLoad'; + exports JNI_OnUnload name 'JNI_Unload'; {$ELSE} begin EntryPoint -- 2.29.2