Open a284628487 opened 6 years ago
jint GetGrade(JNIJcf *jcf, jobject jobj) {
return 27;
}
#if defined(__cplusplus)
JNIJcf* GetJcf() {
struct _JNIJcf jcf;
jcf.functions->GetGrade = GetGrade;
return &jcf;
}
#else
JNIJcf* GetJcf() {
struct JNIJcfInterface jcf;
jcf.GetGrade = GetGrade;
return (JNIJcf*)(&jcf);
}
#endif
Cpp调用C
invoker.cpp
如果在C中调用JNIJcf,则:
实现namespace方法
whatS2.cpp
定义C/C++适用函数
jcf.h