From 42a1f8c8bdb34242f422d24c4ad1d67a1e7ffd25 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sun, 25 Jun 2023 07:45:56 +0200
Subject: GlueGen: Fix Type.getSignature(..): Test for isFunctionPointer() to
elaborate on FunctionType as getTargetType() only retruns a function-ptr and
no more a function-type.
---
src/java/com/jogamp/gluegen/cgram/types/Type.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
(limited to 'src/java/com/jogamp/gluegen/cgram')
diff --git a/src/java/com/jogamp/gluegen/cgram/types/Type.java b/src/java/com/jogamp/gluegen/cgram/types/Type.java
index ae377dc..aa7f845 100644
--- a/src/java/com/jogamp/gluegen/cgram/types/Type.java
+++ b/src/java/com/jogamp/gluegen/cgram/types/Type.java
@@ -184,15 +184,18 @@ public abstract class Type implements SemanticEqualityOp, ASTLocusTagProvider {
} else {
sb.append("ANON");
}
- final Type targetType = getTargetType();
- if( null != targetType && this != targetType ) {
+ if ( isFunctionPointer() ) {
sb.append(" -> ");
- if (!targetType.isFunction()) {
+ final FunctionType ft = getTargetFunction();
+ sb.append(ft.toString(null /* functionName */, null /* callingConvention */, false, true));
+ } else {
+ final Type targetType = getTargetType();
+ if( null != targetType && this != targetType ) {
+ sb.append(" -> ");
sb.append("(" + targetType.toString() + ") * " + getCVAttributesString());
- } else {
- sb.append(((FunctionType) targetType).toString(null /* functionName */, null /* callingConvention */, false, true));
}
}
+
if( GlueGen.debug() ) {
sb.append(", o=0x"+Integer.toHexString(objHash()));
}
@@ -594,7 +597,7 @@ public abstract class Type implements SemanticEqualityOp, ASTLocusTagProvider {
* If this is an array or pointer method returns the next target element type, otherwise `this`.
*
*
- * In this is a {@link #isFunctionPointer()} type, `this` function {#link PointerType} is returned.
+ * In this is a {@link #isFunctionPointer()} type, `this` function {@link PointerType} is returned.
*
* @see #getBaseType()
* @see #getTargetFunction()
--
cgit v1.2.3