I was going through JNI tutorial and I came across below line in generated header file.
JNIEXPORT jbyteArray JNICALL Java_ReadFile_loadFile
(JNIEnv *, jobject, jstring);
I can understand the meaning of jbyteArray, JNIEnv, jobject and jstring.These are required to pass information to and from c program. But I was not able to understand why are JNIEXPORT and JNICALL are used. And what are these termed as in c program(function, Structure, Enum – I regret if this question is very trivial)? Any help is appreciated.
See here section 12.4
For example, in my jvm (Ubuntu 32bit), the header file
jni_md.hcontains:Which will make your function look like:
jbyteArray Java_ReadFile_loadFile
(JNIEnv *, jobject, jstring);
While win32 jni_md.h contains:
Since windows use different calling conventions and your function will look like: