当前位置: 技术问答>java相关
JNICALL是不是JAVA里面的东西?那JNICALL是什么类型?
来源: 互联网 发布时间:2015-02-26
本文导语: 我现在在编译tomcat3.3中的mod_jk模块,发现如下错误 cc -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -U__STR__ -DAIX_BIND_PROCESSOR -qnog enpcomp -qnousepcomp -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -DSHARED_MODU LE -I/rtdb/apache/apache/include -I../commo...
我现在在编译tomcat3.3中的mod_jk模块,发现如下错误
cc -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -U__STR__ -DAIX_BIND_PROCESSOR -qnog
enpcomp -qnousepcomp -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -DSHARED_MODU
LE -I/rtdb/apache/apache/include -I../common -c ../common/jk_jni_worker.c
"../common/jk_jni_worker.c", line 739.28: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,const struct JNINativeInterface_***,
void*)" and "void*" is not allowed.
"../common/jk_jni_worker.c", line 740.34: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,int,int*)" and "void*" is not allowe
d.
"../common/jk_jni_worker.c", line 741.43: 1506-068 (W) Operation between types "
long(*)(void*)" and "void*" is not allowed.
在程序中队应为:
739: jni_create_java_vm =dlsym(handle, "JNI_CreateJavaVM");
740: jni_get_created_java_vms = dlsy(handle, "JNI_GetCreatedJavaVMs");
741: jni_get_default_java_vm_init_args = dlsym(handle, "JNI_GetDefaultJavaVMI
jni_create_java_vm 从如下行中发现可能为 JNICALL类型
jint (JNICALL *jni_create_java_vm)(JavaVM **, JNIEnv **, void *) = NULL;
但如果把739行进行类型强制转换如下(我不能肯定我的做法正确):
jni_create_java_vm =(JNICALL *)dlsym(handle, "JNI_CreateJavaVM");
或
jni_create_java_vm =(JNICALL)dlsym(handle, "JNI_CreateJavaVM");
则提示如下错误:
"../common/jk_jni_worker.c", line 741.39: 1506-275 (S) Unexpected text ')' encou
ntered.
"../common/jk_jni_worker.c", line 741.40: 1506-271 (S) The indirection operator
cannot be applied to a void pointer.
"../common/jk_jni_worker.c", line 741.75: 1506-277 (S) Syntax error: possible mi
ssing ')' or ','?
"../common/jk_jni_worker.c", line 741.28: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,const struct JNINativeInterface_***,
void*)" and "unsigned char*" is not allowed.
"../common/jk_jni_worker.c", line 743.43: 1506-068 (W) Operation between types "
long(*)(void*)" and "void*" is not allowed.
这个错误怎么修改?我的做法是否正确?请指教!
cc -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -U__STR__ -DAIX_BIND_PROCESSOR -qnog
enpcomp -qnousepcomp -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -DSHARED_MODU
LE -I/rtdb/apache/apache/include -I../common -c ../common/jk_jni_worker.c
"../common/jk_jni_worker.c", line 739.28: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,const struct JNINativeInterface_***,
void*)" and "void*" is not allowed.
"../common/jk_jni_worker.c", line 740.34: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,int,int*)" and "void*" is not allowe
d.
"../common/jk_jni_worker.c", line 741.43: 1506-068 (W) Operation between types "
long(*)(void*)" and "void*" is not allowed.
在程序中队应为:
739: jni_create_java_vm =dlsym(handle, "JNI_CreateJavaVM");
740: jni_get_created_java_vms = dlsy(handle, "JNI_GetCreatedJavaVMs");
741: jni_get_default_java_vm_init_args = dlsym(handle, "JNI_GetDefaultJavaVMI
jni_create_java_vm 从如下行中发现可能为 JNICALL类型
jint (JNICALL *jni_create_java_vm)(JavaVM **, JNIEnv **, void *) = NULL;
但如果把739行进行类型强制转换如下(我不能肯定我的做法正确):
jni_create_java_vm =(JNICALL *)dlsym(handle, "JNI_CreateJavaVM");
或
jni_create_java_vm =(JNICALL)dlsym(handle, "JNI_CreateJavaVM");
则提示如下错误:
"../common/jk_jni_worker.c", line 741.39: 1506-275 (S) Unexpected text ')' encou
ntered.
"../common/jk_jni_worker.c", line 741.40: 1506-271 (S) The indirection operator
cannot be applied to a void pointer.
"../common/jk_jni_worker.c", line 741.75: 1506-277 (S) Syntax error: possible mi
ssing ')' or ','?
"../common/jk_jni_worker.c", line 741.28: 1506-068 (W) Operation between types "
long(*)(const struct JNIInvokeInterface_***,const struct JNINativeInterface_***,
void*)" and "unsigned char*" is not allowed.
"../common/jk_jni_worker.c", line 743.43: 1506-068 (W) Operation between types "
long(*)(void*)" and "void*" is not allowed.
这个错误怎么修改?我的做法是否正确?请指教!
|
JNICALL是JAVA调用本地方法时,用C/C++写的本地方法库中的函数导出方式,是一个C/C++里的宏:
#define JNICALL __stdcall
#define JNICALL __stdcall
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。