summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/procaddress
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-11 15:10:15 +0100
committerSven Gothel <[email protected]>2015-03-11 15:10:15 +0100
commitbbea09816015ecf3596acdcc033553127fcc0ef3 (patch)
treeab38152b5b74ee7d99e955658c7778de4181438b /src/java/com/jogamp/gluegen/procaddress
parent25f248669f603c2bbd6ad97f31e0c72ce780f507 (diff)
Bug 1144 - Add 'DelegateImplementation': Requires own MethodBinding for delegates impl. / Adding ReturnsOpaque
- DelegateImplementation requires own MethodBinding for delegates impl. The delegation name must be included within the FunctionSymbol's aliases _only_ for implementations, where delegation applies. This allows all subsequent type/cfg checks to hit on AliasedSymbol! Hence we need to create individual MethodBinding instances for interfaces and public/private implementations. - Adding ReturnsOpaque Configuration: ReturnsOpaque <Primitive Java Type> <Function Name> This feature is necessary to achieve 'Opaque' functionality for function's return type - instead of types in general. - Fix AliasedSymbolImpl copy-ctor, i.e. this.name = o.name !
Diffstat (limited to 'src/java/com/jogamp/gluegen/procaddress')
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java19
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java2
2 files changed, 6 insertions, 15 deletions
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
index 423efe9..ec29b08 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
@@ -55,7 +55,6 @@ import com.jogamp.gluegen.FunctionEmitter;
import com.jogamp.gluegen.JavaConfiguration;
import com.jogamp.gluegen.JavaEmitter;
import com.jogamp.gluegen.JavaMethodBindingEmitter;
-import com.jogamp.gluegen.MethodBinding;
import com.jogamp.gluegen.cgram.types.FunctionSymbol;
import com.jogamp.gluegen.cgram.types.Type;
import com.jogamp.gluegen.cgram.types.TypeDictionary;
@@ -115,8 +114,8 @@ public class ProcAddressEmitter extends JavaEmitter {
}
@Override
- protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
- return generateMethodBindingEmittersImpl(methodBindingSet, sym);
+ protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final FunctionSymbol sym) throws Exception {
+ return generateMethodBindingEmittersImpl(sym);
}
protected boolean needsModifiedEmitters(final FunctionSymbol sym) {
@@ -127,8 +126,8 @@ public class ProcAddressEmitter extends JavaEmitter {
}
}
- private List<? extends FunctionEmitter> generateMethodBindingEmittersImpl(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
- final List<? extends FunctionEmitter> defaultEmitters = super.generateMethodBindingEmitters(methodBindingSet, sym);
+ private List<? extends FunctionEmitter> generateMethodBindingEmittersImpl(final FunctionSymbol sym) throws Exception {
+ final List<? extends FunctionEmitter> defaultEmitters = super.generateMethodBindingEmitters(sym);
// if the superclass didn't generate any bindings for the symbol, let's
// honor that (for example, the superclass might have caught an Ignore
@@ -153,7 +152,7 @@ public class ProcAddressEmitter extends JavaEmitter {
if ( callThroughProcAddress ) {
if (getProcAddressConfig().emitProcAddressTable()) {
// emit an entry in the GL proc address table for this method.
- emitProcAddressTableEntryForString(getAliasedSymName(sym));
+ emitProcAddressTableEntryForString(sym.getName());
}
}
for (final FunctionEmitter emitter : defaultEmitters) {
@@ -267,14 +266,6 @@ public class ProcAddressEmitter extends JavaEmitter {
emitters.add(res);
}
- private String getAliasedSymName(final FunctionSymbol sym) {
- String symName = getConfig().getJavaSymbolRename(sym.getName());
- if (null == symName) {
- symName = sym.getName();
- }
- return symName;
- }
-
protected boolean callThroughProcAddress(final FunctionSymbol sym) {
final ProcAddressConfiguration cfg = getProcAddressConfig();
boolean res = false;
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
index 3faf155..5298a8d 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
@@ -120,7 +120,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
super.emitPreCallSetup(binding, writer);
if (callThroughProcAddress) {
- final String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX + binding.getName();
+ final String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX + binding.getNativeName();
writer.println(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
writer.println(" if (__addr_ == 0) {");
writer.format(" throw new %s(String.format(\"Method \\\"%%s\\\" not available\", \"%s\"));%n",