dukeify / fake-jni

An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an explicit example for registering function overloads via fake-jni

Matthewacon opened this issue · comments

using namespace FakeJni;

struct NativeClass {
 DEFINE_CLASS_NAME("com/example/NativeClass")

 void func() {}
 void func(JInt) {}
};

BEGIN_NATIVE_DESCRIPTOR(NativeClass)
 {Constructor<NativeClass> {}},
 {(void (*)())&NativeClass::func, "func"},
 {(void (*)(JInt))&NativeClass::func, "func"}
END_NATIVE_DESCRIPTOR