summaryrefslogtreecommitdiffstats
path: root/src/java/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-06-18 03:31:19 +0200
committerSven Gothel <[email protected]>2023-06-18 03:31:19 +0200
commit5a19d4fb868f7459dc81ee7e82e1040f79a87544 (patch)
tree95bc2432cb5f2d4f8b4d3a7b98dace7e180f08df /src/java/com
parenteec3f21c3597ff9bf9760a06e00dd341214ea90d (diff)
GlueGen Struct [10]: Don't skip primitive w/ platform dependent sized type in struct (like 'int') ..
We already support platform dependent sizes like pointer etc, no reason to drop e.g. 'int'. Note: 'int' is also always 32bit of size within our current set of supported platforms, e.g. MachineDataInfo. Further fix and clarify primCElemFixedSize and primElemSizeExpr, only to be true and set if isPrimitive.
Diffstat (limited to 'src/java/com')
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 0b30b20..3dde018 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -1650,16 +1650,8 @@ public class JavaEmitter implements GlueEmitter {
fieldType.getASTLocusTag(), e);
}
baseJElemTypeName = baseJElemType.getName();
- primCElemFixedSize = isPrimitive ? baseCElemType.getSize().hasFixedNativeSize() : true;
+ primCElemFixedSize = isPrimitive ? baseCElemType.getSize().hasFixedNativeSize() : false;
baseCElemSizeDenominator = baseCElemType.isPointer() ? "pointer" : baseJElemTypeName ;
-
- if( !primCElemFixedSize ) {
- final String msg = "SKIP primitive w/ platform dependent sized type in struct: "+returnSizeLookupName+": "+fieldType.getDebugString();
- unit.emitln(" // "+msg);
- unit.emitln();
- LOG.log(WARNING, structCType.getASTLocusTag(), msg);
- return;
- }
}
if( GlueGen.debug() ) {
System.err.printf("SE.ac.%02d: baseJElemType %s%n", (i+1), (null != baseJElemType ? baseJElemType.getDebugString() : null));
@@ -1682,16 +1674,17 @@ public class JavaEmitter implements GlueEmitter {
primJElemTypeBufferName = primJElemTypeBufferClazz.getSimpleName();
primElemSize = Buffers.sizeOfBufferElem(primJElemTypeBufferClazz);
isByteBuffer = null != primJElemTypeBufferClazz ? ByteBuffer.class.isAssignableFrom(primJElemTypeBufferClazz) : false;
+ if( primCElemFixedSize ) {
+ primElemSizeExpr = String.valueOf(primElemSize);
+ } else {
+ primElemSizeExpr = "md."+baseCElemSizeDenominator+"SizeInBytes()";
+ }
} else {
primJElemTypeBufferClazz = null;
primJElemTypeBufferName = null;
primElemSize = 0;
isByteBuffer = false;
- }
- if( primCElemFixedSize ) {
- primElemSizeExpr = String.valueOf(primElemSize);
- } else {
- primElemSizeExpr = "md."+baseCElemSizeDenominator+"SizeInBytes()";
+ primElemSizeExpr = null;
}
final String capitalFieldName = capitalizeString(fieldName);