diff options
Diffstat (limited to 'sample-android/templates/initclass_preamble.kte')
| -rw-r--r-- | sample-android/templates/initclass_preamble.kte | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/sample-android/templates/initclass_preamble.kte b/sample-android/templates/initclass_preamble.kte deleted file mode 100644 index 20619c1..0000000 --- a/sample-android/templates/initclass_preamble.kte +++ /dev/null @@ -1,41 +0,0 @@ -<%-- - Copyright (C) 2024 The Qt Company Ltd. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied - See the License for the specific language governing permissions and - limitations under the License. ---%> - -@import io.github.landerlyoung.jenny.JteData -@import io.github.landerlyoung.jenny.Constants -@import io.github.landerlyoung.jenny.HandyHelper -@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord -@import javax.lang.model.type.TypeKind - -@param jteData: JteData -${jteData.initClassPrefix} bool ${jteData.className}::initClazz(JNIEnv* env) { -#define JENNY_CHECK_NULL(val) \ - do { \ - if ((val) == nullptr) { \ -@if (!jteData.environment.configurations.errorLoggerFunction.isNullOrBlank()) ${jteData.environment.configurations.errorLoggerFunction}(env, "can't init ${jteData.className}::" #val); \@else env->ExceptionDescribe(); \@endif - return false; \ - } \ - } while(false) - - auto& state = getClassInitState(); -@if (jteData.environment.configurations.threadSafe) - if (!state.sInited) { - std::lock_guard<std::mutex> lg(state.sInitLock); -@endif - if (!state.sInited) { - auto clazz = env->FindClass(FULL_CLASS_NAME); - JENNY_CHECK_NULL(clazz); - state.sClazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz)); - env->DeleteLocalRef(clazz); - JENNY_CHECK_NULL(state.sClazz);
\ No newline at end of file |
