我现在在编译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.
这个错误怎么修改?我的做法是否正确?请指教!
|
JNICALL是JAVA调用本地方法时,用C/C++写的本地方法库中的函数导出方式,是一个C/C++里的宏:
#define JNICALL __stdcall