From: Bernhard Urban Date: Wed, 25 Apr 2012 19:24:29 +0000 (+0200) Subject: invokevirtual: native methods X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=commitdiff_plain;h=35058934e4741a85698c95fcbb46ade87c50bb3c invokevirtual: native methods --- diff --git a/ffi/native.c b/ffi/native.c index d743d57..f335c5c 100644 --- a/ffi/native.c +++ b/ffi/native.c @@ -9,3 +9,8 @@ void tests_Native1__printSomething___I_V(int a) { printf("printSomething: 0x%08x\n", a); } + +void tests_Instance5__printX___I_V(int a) +{ + printf("printX: 0x%08x\n", a); +} diff --git a/tests/Instance5.java b/tests/Instance5.java new file mode 100644 index 0000000..8c8ff84 --- /dev/null +++ b/tests/Instance5.java @@ -0,0 +1,21 @@ +package tests; + +public class Instance5 { + public int x; + public Instance5() { + x = 0x11; + } + + public static void main(String []args) { + Instance5 a = new Instance5(); + + a.setX(0x1337); + a.printX(a.x); + } + + public void setX(int a) { + this.x = a; + } + + public native void printX(int x); +}