summaryrefslogtreecommitdiffstats
path: root/ndk
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-08-24 09:27:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-08-24 09:27:58 -0700
commitaa109fa96d1b55d7de4654fe28e48d153fccb208 (patch)
tree5077e1545148bd30579da11a6db1b1bfbb2cfbc5 /ndk
parent58df39a59192d1127fb034cb129512489c411715 (diff)
parent7e901892af103efd41a3967d67063df988c3ebd7 (diff)
downloadandroid_development-aa109fa96d1b55d7de4654fe28e48d153fccb208.tar.gz
android_development-aa109fa96d1b55d7de4654fe28e48d153fccb208.tar.bz2
android_development-aa109fa96d1b55d7de4654fe28e48d153fccb208.zip
am 7e901892: am c40f3ba4: am 3ee119cd: Merge "ndk: update JNIEXPORT declaration in <jni.h>"
* commit '7e901892af103efd41a3967d67063df988c3ebd7': ndk: update JNIEXPORT declaration in <jni.h>
Diffstat (limited to 'ndk')
-rw-r--r--ndk/platforms/android-3/include/jni.h48
1 files changed, 32 insertions, 16 deletions
diff --git a/ndk/platforms/android-3/include/jni.h b/ndk/platforms/android-3/include/jni.h
index ad954c8f6..495902cd0 100644
--- a/ndk/platforms/android-3/include/jni.h
+++ b/ndk/platforms/android-3/include/jni.h
@@ -1,13 +1,28 @@
/*
- * Copyright 2006 The Android Open Source Project
+ * Copyright (C) 2006 The Android Open Source Project
*
+ * 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.
+ */
+
+/*
* JNI specification, as defined by Sun:
* http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html
*
* Everything here is expected to be VM-neutral.
*/
-#ifndef _JNI_H
-#define _JNI_H
+
+#ifndef JNI_H_
+#define JNI_H_
#include <stdarg.h>
@@ -124,10 +139,10 @@ typedef enum jobjectRefType {
JNIWeakGlobalRefType = 3
} jobjectRefType;
-typedef struct {
- const char* name;
- const char* signature;
- void* fnPtr;
+typedef struct {
+ const char* name;
+ const char* signature;
+ void* fnPtr;
} JNINativeMethod;
struct _JNIEnv;
@@ -1037,7 +1052,7 @@ struct JNIInvokeInterface {
void* reserved0;
void* reserved1;
void* reserved2;
-
+
jint (*DestroyJavaVM)(JavaVM*);
jint (*AttachCurrentThread)(JavaVM*, JNIEnv**, void*);
jint (*DetachCurrentThread)(JavaVM*);
@@ -1097,16 +1112,22 @@ extern "C" {
*
* Note these are the only symbols exported for JNI by the VM.
*/
+#if 0 /* In practice, these are not exported by the NDK so don't declare them */
jint JNI_GetDefaultJavaVMInitArgs(void*);
jint JNI_CreateJavaVM(JavaVM**, JNIEnv**, void*);
jint JNI_GetCreatedJavaVMs(JavaVM**, jsize, jsize*);
+#endif
+
+#define JNIIMPORT
+#define JNIEXPORT __attribute__ ((visibility ("default")))
+#define JNICALL
/*
* Prototypes for functions exported by loadable shared libs. These are
* called by JNI, not provided by JNI.
*/
-jint JNI_OnLoad(JavaVM* vm, void* reserved);
-void JNI_OnUnload(JavaVM* vm, void* reserved);
+JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved);
+JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved);
#ifdef __cplusplus
}
@@ -1132,9 +1153,4 @@ void JNI_OnUnload(JavaVM* vm, void* reserved);
#define JNI_COMMIT 1 /* copy content, do not free buffer */
#define JNI_ABORT 2 /* free buffer w/o copying back */
-/* need these for Windows-aware headers */
-#define JNIIMPORT
-#define JNIEXPORT
-#define JNICALL
-
-#endif /*_JNI_H*/
+#endif /* JNI_H_ */