diff --git a/wrappers/java/jni.mustache b/wrappers/java/jni.mustache index 14c268f79..a26da67df 100644 --- a/wrappers/java/jni.mustache +++ b/wrappers/java/jni.mustache @@ -123,7 +123,7 @@ static void linphone_android_ortp_log_handler(const char *domain, OrtpLogLevel l bctbx_free(str); } -void Java_org_linphone_core_FactoryImpl_setDebugMode(JNIEnv* env, jobject thiz, jboolean isDebug, jstring jdebugTag) { +extern "C" void Java_org_linphone_core_FactoryImpl_setDebugMode(JNIEnv* env, jobject thiz, jboolean isDebug, jstring jdebugTag) { if (isDebug) { LogDomain = GetStringUTFChars(env, jdebugTag); linphone_core_enable_logs_with_cb(linphone_android_ortp_log_handler); @@ -306,6 +306,10 @@ static {{return}} {{callbackName}}({{params}}) { {{/callbacks}} ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + {{#interfaces}} {{#isSingleListener}} void {{jniPackage}}{{className}}Impl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { @@ -421,4 +425,8 @@ jobject {{jni_package}}CoreImpl_getMediastreamerFactory(JNIEnv *env, jobject thi {{/bytes}}{{#hasReturn}}return jni_result;{{/hasReturn}}{{#hasListReturn}}return jni_list_result;{{/hasListReturn}} } -{{/methods}} \ No newline at end of file +{{/methods}} + +#ifdef __cplusplus +} +#endif \ No newline at end of file