diff options
author | Liong Sauw Ming <ming@teluu.com> | 2014-09-23 04:13:40 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2014-09-23 04:13:40 +0000 |
commit | 76631c2519ae0dc653828d2eda184271cedd5aae (patch) | |
tree | 886000218fd4cc4d7fe0eeaf8e9a6ad98de6d2a0 /pjlib | |
parent | e35a31561e00b573aca6e9c693b0271019089a1a (diff) |
Fixed #1792: Create generic JNI OnLoad function
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4927 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/src/pj/os_core_unix.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index 34a1f48d..9f8578a1 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -49,6 +49,24 @@ #define SIGNATURE1 0xDEAFBEEF #define SIGNATURE2 0xDEADC0DE +#ifndef PJ_JNI_HAS_JNI_ONLOAD +# define PJ_JNI_HAS_JNI_ONLOAD PJ_ANDROID +#endif + +#if defined(PJ_JNI_HAS_JNI_ONLOAD) && PJ_JNI_HAS_JNI_ONLOAD != 0 + +#include <jni.h> + +JavaVM *pj_jni_jvm = NULL; + +JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) +{ + pj_jni_jvm = vm; + + return JNI_VERSION_1_4; +} +#endif + struct pj_thread_t { char obj_name[PJ_MAX_OBJ_NAME]; |