summaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/jogamp/gluegen/JavaConfiguration.java7
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java
index 107b8c3..95e1480 100644
--- a/src/java/com/jogamp/gluegen/JavaConfiguration.java
+++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java
@@ -2517,4 +2517,11 @@ public class JavaConfiguration {
/** Mapped binding name to {@link JavaCallbackInfo} */
/* pp */ final Map<String, JavaCallbackInfo> setFuncToJavaCallbackMap = new HashMap<String, JavaCallbackInfo>();
final Set<String> emittedJavaCallbackUserParamClasses = new HashSet<String>();
+
+ /** Returns true if a method binding requires specific java callback code */
+ final boolean requiresJavaCallbackCode(final String bindingName) {
+ final JavaCallbackInfo jcbi = setFuncToJavaCallbackMap.get(bindingName);
+ return null != jcbi && !jcbi.cbUserParamIsDefined;
+ }
+
}
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 0936536..1f1f8af 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -465,9 +465,11 @@ public class JavaEmitter implements GlueEmitter {
final boolean isUnimplemented = cfg.isUnimplemented(cSymbol);
final List<String> prologue = cfg.javaPrologueForMethod(binding, false, false);
final List<String> epilogue = cfg.javaEpilogueForMethod(binding, false, false);
+ final boolean needsJavaCallbackCode = cfg.requiresJavaCallbackCode( binding.getName() );
final boolean needsBody = isUnimplemented ||
binding.needsNIOWrappingOrUnwrapping() ||
binding.signatureUsesJavaPrimitiveArrays() ||
+ needsJavaCallbackCode ||
null != prologue ||
null != epilogue;
@@ -531,6 +533,7 @@ public class JavaEmitter implements GlueEmitter {
final boolean hasPrologueOrEpilogue =
cfg.javaPrologueForMethod(binding, false, false) != null ||
cfg.javaEpilogueForMethod(binding, false, false) != null ;
+ final boolean needsJavaCallbackCode = cfg.requiresJavaCallbackCode( binding.getName() );
if ( !cfg.isUnimplemented( cSymbol ) ) {
// If we already generated a public native entry point for this
@@ -541,7 +544,7 @@ public class JavaEmitter implements GlueEmitter {
// the private native entry point for it along with the version
// taking only NIO buffers
if ( !binding.signatureUsesJavaPrimitiveArrays() &&
- ( binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue )
+ ( binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue || needsJavaCallbackCode )
)
{
final CodeUnit unit = (cfg.allStatic() ? javaUnit() : javaImplUnit());
@@ -588,7 +591,7 @@ public class JavaEmitter implements GlueEmitter {
cfg.implClassName(),
true, // NOTE: we always disambiguate with a suffix now, so this is optional
cfg.allStatic(),
- (binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue ),
+ (binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue || needsJavaCallbackCode),
!cfg.useNIODirectOnly(binding.getName()),
machDescJava, getConfig());
prepCEmitter(binding.getName(), binding.getJavaReturnType(), cEmitter);