aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-11 08:42:26 +0100
committerSven Gothel <[email protected]>2015-03-11 08:42:26 +0100
commitf664f7e950ff60d73e488801cf7f37878588203d (patch)
tree1519877aea5e702b9218df8c04f47492364ee35f /src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
parentc3b2a86bb9051d6f03c3f104eff2dbe6cefc1803 (diff)
Bug 1144 - Add 'DelegateImplementation': Cleanup MethodBinding/FunctionBinding Semantics
- Clarify name semantics: name -> [interfaceName, implName, nativeName] - JavaMethodBindingEmitter: Refine native identity via isNativeMethod + isPrivateNativeMethod - ProcAddressEmitter: Remove hack whether we need to wrap .. use isNativeMethod + isPrivateNativeMethod
Diffstat (limited to 'src/java/com/jogamp/gluegen/CMethodBindingEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/CMethodBindingEmitter.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
index 1987668..bb95226 100644
--- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
@@ -150,8 +150,16 @@ public class CMethodBindingEmitter extends FunctionEmitter {
public final MethodBinding getBinding() { return binding; }
@Override
- public String getName() {
- return binding.getName();
+ public String getInterfaceName() {
+ return binding.getInterfaceName();
+ }
+ @Override
+ public String getImplName() {
+ return binding.getImplName();
+ }
+ @Override
+ public String getNativeName() {
+ return binding.getNativeName();
}
@Override
@@ -313,12 +321,8 @@ public class CMethodBindingEmitter extends FunctionEmitter {
writer.print("_");
if (isOverloadedBinding) {
writer.print(jniMangle(binding));
- //System.err.println("OVERLOADED MANGLING FOR " + getName() +
- // " = " + jniMangle(binding));
} else {
- writer.print(JavaEmitter.jniMangle(getName()));
- //System.err.println(" NORMAL MANGLING FOR " + binding.getName() +
- // " = " + jniMangle(getName()));
+ writer.print(JavaEmitter.jniMangle(getImplName()));
}
}
@@ -990,7 +994,7 @@ public class CMethodBindingEmitter extends FunctionEmitter {
// Call through function pointer
writer.print(CMethodBindingEmitter.cThisArgumentName() + "->");
}
- writer.print(binding.getCSymbol().getOrigName()); // use original API name
+ writer.print(getNativeName());
writer.print("(");
emitBodyPassCArguments(writer);
writer.println(");");
@@ -1166,7 +1170,7 @@ public class CMethodBindingEmitter extends FunctionEmitter {
protected String jniMangle(final MethodBinding binding) {
final StringBuilder buf = new StringBuilder();
- buf.append(JavaEmitter.jniMangle(getName()));
+ buf.append(JavaEmitter.jniMangle(getImplName()));
buf.append(getImplSuffix());
buf.append("__");
if (binding.hasContainingType()) {
@@ -1277,7 +1281,7 @@ public class CMethodBindingEmitter extends FunctionEmitter {
writer.println(" (*env)->ThrowNew(env, (*env)->FindClass(env, \"java/lang/OutOfMemoryError\"),");
writer.print(" \"" + errorMessage);
writer.print(" in native dispatcher for \\\"");
- writer.print(getName());
+ writer.print(getInterfaceName());
writer.println("\\\"\");");
writer.print(" return");
if (!binding.getJavaReturnType().isVoid()) {