summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2018-12-26 11:04:16 -0600
committerSven Gothel <[email protected]>2019-08-16 23:58:53 +0200
commit93121714758f89a394993f0740c6929f48fb887b (patch)
tree695ad902e210de1efe6d4813f6239e2aa4dadc20
parent3ae05eacc091282f009792e2b06505efe96cca7d (diff)
Fixed CStruct annotation processor to not use dummy Java variable types
When annotations were placed on dummy Java variables, the annotation processor was emitting a RenameJavaType directive into the gluegen config file that caused the emitted file to be named boolean.java instead of RenderingConfig.java or Pixel.java. Turned off this behavior when jname is given in the @CStruct annotation. I'm uncertain how much this processor is even used, since I can't find any occurrences of @CStruct outside the test code for it in gluegen.
-rw-r--r--src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java2
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/structgen/package-info.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java
index 2fc0766..45293f8 100644
--- a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java
+++ b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java
@@ -249,7 +249,7 @@ public class CStructAnnotationProcessor extends AbstractProcessor {
writer = new FileWriter(configFile);
writer.write("Package "+pakage+"\n");
writer.write("EmitStruct "+structName+"\n");
- if( finalType != structName ) {
+ if( !useJavaName && (finalType != structName) ) {
// We allow renaming the structType to the element's declaredType (FIELD annotation only)
writer.write("RenameJavaType " + struct.name()+" " + declaredType +"\n");
}
diff --git a/src/junit/com/jogamp/gluegen/test/junit/structgen/package-info.java b/src/junit/com/jogamp/gluegen/test/junit/structgen/package-info.java
index d009c5f..5f211c4 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/structgen/package-info.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/structgen/package-info.java
@@ -7,7 +7,7 @@
* </p>
* @see BuildStruct01
*/
-@CStructs({@CStruct(name="RenderingConfig", header="TestStruct01.h"), @CStruct(name="Pixel", header="TestStruct02.h")})
+@CStructs({@CStruct(name="RenderingConfig", jname="RenderingConfig", header="TestStruct01.h"), @CStruct(name="Pixel", jname="Pixel", header="TestStruct02.h")})
package com.jogamp.gluegen.test.junit.structgen;
import com.jogamp.gluegen.structgen.CStructs;