From 195bf966e4946ee9e80cd7aec68685218ad7a777 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Jun 2023 05:27:41 +0200 Subject: CustomJNICode: Fix/complete commit d7bc10d7ff0e3a30d74c4e4c439230f3983bcfb4: Add emitCustomJNICode(..) for JavaEmitter.endFunctions() not just structs and fix the JNI-c stub code --- .../gluegen/test/junit/generation/test1-CustomJNICode.cfg | 13 ------------- .../gluegen/test/junit/generation/test1-CustomJavaCode.cfg | 12 ------------ .../test/junit/generation/test1-CustomJavaCode.java.stub | 12 ++++++++++++ .../jogamp/gluegen/test/junit/generation/test1-common.cfg | 8 ++++---- .../test/junit/generation/test1p2-CustomJNICode.c.stub | 5 +++++ 5 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJNICode.cfg delete mode 100644 src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.cfg create mode 100644 src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.java.stub create mode 100644 src/junit/com/jogamp/gluegen/test/junit/generation/test1p2-CustomJNICode.c.stub (limited to 'src/junit') diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJNICode.cfg b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJNICode.cfg deleted file mode 100644 index b76997d..0000000 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJNICode.cfg +++ /dev/null @@ -1,13 +0,0 @@ -#include "test1.h" - -JNIEXPORT jobject JNICALL -com.jogamp.gluegen.test.junit.generation -Java_com_jogamp_gluegen_test_junit_generation_Bindingtest1p1_I_returnFooImpl(JNIEnv *env, jobject _unused) { - return FOO_VALUE; -} - -JNIEXPORT jobject JNICALL -com.jogamp.gluegen.test.junit.generation -Java_com_jogamp_gluegen_test_junit_generation_Bindingtest1p2_I_returnFooImpl(JNIEnv *env, jobject _unused) { - return FOO_VALUE; -} \ No newline at end of file diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.cfg b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.cfg deleted file mode 100644 index c210ec9..0000000 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.cfg +++ /dev/null @@ -1,12 +0,0 @@ - -@Override -public int testDelegate(int v) { - return testDelegateOrigImpl(v) + 1; -} - -private native int returnFooImpl(); - -public int getFoo() { - return returnFooImpl(); -}; - diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.java.stub b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.java.stub new file mode 100644 index 0000000..c210ec9 --- /dev/null +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-CustomJavaCode.java.stub @@ -0,0 +1,12 @@ + +@Override +public int testDelegate(int v) { + return testDelegateOrigImpl(v) + 1; +} + +private native int returnFooImpl(); + +public int getFoo() { + return returnFooImpl(); +}; + diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg index e01f748..05bed70 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg @@ -48,10 +48,10 @@ RenameJavaSymbol testXID_EXT testXID DelegateImplementation testDelegate testDelegateOrigImpl CustomJavaCode Bindingtest1 public int getFoo(); -IncludeAs CustomJavaCode Bindingtest1p1Impl test1-CustomJavaCode.cfg -IncludeAs CustomJNICode Bindingtest1p1Impl test1-CustomJNICode.cfg -IncludeAs CustomJavaCode Bindingtest1p2Impl test1-CustomJavaCode.cfg -IncludeAs CustomJNICode Bindingtest1p2Impl test1-CustomJNICode.cfg +IncludeAs CustomJavaCode Bindingtest1p1Impl test1-CustomJavaCode.java.stub +IncludeAs CustomJNICode Bindingtest1p1Impl test1p1-CustomJNICode.c.stub +IncludeAs CustomJavaCode Bindingtest1p2Impl test1-CustomJavaCode.java.stub +IncludeAs CustomJNICode Bindingtest1p2Impl test1p2-CustomJNICode.c.stub StructPackage TK_Dimension com.jogamp.gluegen.test.junit.generation EmitStruct TK_Dimension diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1p2-CustomJNICode.c.stub b/src/junit/com/jogamp/gluegen/test/junit/generation/test1p2-CustomJNICode.c.stub new file mode 100644 index 0000000..bee94f2 --- /dev/null +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1p2-CustomJNICode.c.stub @@ -0,0 +1,5 @@ + +JNIEXPORT jint JNICALL Java_com_jogamp_gluegen_test_junit_generation_impl_Bindingtest1p2Impl_returnFooImpl(JNIEnv *env, jobject _unused) { + return FOO_VALUE; +} + -- cgit v1.2.3