diff options
author | Elliott Hughes <enh@google.com> | 2011-07-13 17:50:40 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2013-11-07 10:42:10 -0800 |
commit | c3cfad989c612f749ea24ed641a64e619cc5bb9d (patch) | |
tree | 2f08a0b43987eb1ef3e3064938ead224cde00c17 | |
parent | 5063dbfbbb296800565a2b7b88a57ea9f21ba368 (diff) | |
download | libcore-c3cfad989c612f749ea24ed641a64e619cc5bb9d.zip libcore-c3cfad989c612f749ea24ed641a64e619cc5bb9d.tar.gz libcore-c3cfad989c612f749ea24ed641a64e619cc5bb9d.tar.bz2 |
Make libjavacore (libcore's JNI library) use JNI_OnLoad.
One other change here is that I've removed ExpatParser's dependency on
libcutils, switching the relevant code to use ICU instead.
(cherry picked from commit ab4b6905b5b100f251818bcfc68192ff736af7b7)
Change-Id: Id3758b31c3c76043ee1923223a243116188196c3
-rw-r--r-- | luni/src/main/native/Register.cpp | 3 | ||||
-rw-r--r-- | luni/src/main/native/java_lang_Double.cpp | 4 | ||||
-rw-r--r-- | luni/src/main/native/java_lang_Float.cpp | 4 | ||||
-rw-r--r-- | luni/src/main/native/java_lang_Math.cpp | 1 | ||||
-rw-r--r-- | luni/src/main/native/sub.mk | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/luni/src/main/native/Register.cpp b/luni/src/main/native/Register.cpp index b1cef1f..15f6953 100644 --- a/luni/src/main/native/Register.cpp +++ b/luni/src/main/native/Register.cpp @@ -23,7 +23,7 @@ #include <stdlib.h> // DalvikVM calls this on startup, so we can statically register all our native methods. -int JNI_OnLoad(JavaVM* vm, void*) { +jint JNI_OnLoad(JavaVM* vm, void*) { JNIEnv* env; if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { ALOGE("JavaVM::GetEnv() failed"); @@ -75,5 +75,6 @@ int JNI_OnLoad(JavaVM* vm, void*) { REGISTER(register_org_apache_harmony_xml_ExpatParser); REGISTER(register_sun_misc_Unsafe); #undef REGISTER + return JNI_VERSION_1_6; } diff --git a/luni/src/main/native/java_lang_Double.cpp b/luni/src/main/native/java_lang_Double.cpp index ecbe7e3..186bd26 100644 --- a/luni/src/main/native/java_lang_Double.cpp +++ b/luni/src/main/native/java_lang_Double.cpp @@ -45,6 +45,6 @@ static JNINativeMethod gMethods[] = { NATIVE_METHOD(Double, doubleToRawLongBits, "(D)J"), NATIVE_METHOD(Double, longBitsToDouble, "(J)D"), }; -int register_java_lang_Double(JNIEnv* env) { - return jniRegisterNativeMethods(env, "java/lang/Double", gMethods, NELEM(gMethods)); +void register_java_lang_Double(JNIEnv* env) { + jniRegisterNativeMethods(env, "java/lang/Double", gMethods, NELEM(gMethods)); } diff --git a/luni/src/main/native/java_lang_Float.cpp b/luni/src/main/native/java_lang_Float.cpp index 0cbb551..54191e6 100644 --- a/luni/src/main/native/java_lang_Float.cpp +++ b/luni/src/main/native/java_lang_Float.cpp @@ -44,6 +44,6 @@ static JNINativeMethod gMethods[] = { NATIVE_METHOD(Float, floatToRawIntBits, "(F)I"), NATIVE_METHOD(Float, intBitsToFloat, "(I)F"), }; -int register_java_lang_Float(JNIEnv* env) { - return jniRegisterNativeMethods(env, "java/lang/Float", gMethods, NELEM(gMethods)); +void register_java_lang_Float(JNIEnv* env) { + jniRegisterNativeMethods(env, "java/lang/Float", gMethods, NELEM(gMethods)); } diff --git a/luni/src/main/native/java_lang_Math.cpp b/luni/src/main/native/java_lang_Math.cpp index 784b84d..83c39bd 100644 --- a/luni/src/main/native/java_lang_Math.cpp +++ b/luni/src/main/native/java_lang_Math.cpp @@ -145,7 +145,6 @@ static JNINativeMethod gMethods[] = { NATIVE_METHOD(Math, tan, "!(D)D"), NATIVE_METHOD(Math, tanh, "!(D)D"), }; - void register_java_lang_Math(JNIEnv* env) { jniRegisterNativeMethods(env, "java/lang/Math", gMethods, NELEM(gMethods)); } diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk index 64dbc8c..9e1a05b 100644 --- a/luni/src/main/native/sub.mk +++ b/luni/src/main/native/sub.mk @@ -62,9 +62,9 @@ LOCAL_C_INCLUDES += \ external/openssl/include \ external/zlib +LOCAL_STATIC_LIBRARIES += \ + libfdlibm + LOCAL_SHARED_LIBRARIES += \ liblog \ libnativehelper - -LOCAL_STATIC_LIBRARIES += \ - libfdlibm |