From 61652e08a893692fa42c86b8a5d999dbf9f8f1f1 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 18 Oct 2017 12:03:12 +0200 Subject: [PATCH] Added missing extern C in Java's JNI --- wrappers/java/jni.mustache | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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