diff options
author | Kenneth Russel <[email protected]> | 2008-05-26 18:35:33 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-05-26 18:35:33 +0000 |
commit | 040e730115f8a50b598edb448fc29f8917bde392 (patch) | |
tree | 9b2a78e5dc09d1c693a523355ad74242750e9eef /src/java/com/sun/gluegen/procaddress | |
parent | c84a0811ac16ef8c25f257c1bcee4d386e7afcb9 (diff) |
Added support for passing outgoing arrays of compound types, including
non-const arrays of compound types and the associated copies back to
Java, in support of constructs like eglChooseConfig. Generated code
has been compiled but not yet tested. Refactorings to allow generated
glue code using StructAccessors to work on Java ME / CDC / FP +
JSR-239 NIO, as well as Java SE. Bug fix to ForceProcAddressGen.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@77 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/procaddress')
-rwxr-xr-x | src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java | 3 | ||||
-rwxr-xr-x | src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java index 8dc46ee..84e8132 100755 --- a/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java @@ -153,6 +153,9 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter { // set the function pointer to the value of the passed-in glProcAddress FunctionSymbol cSym = getBinding().getCSymbol(); String funcPointerTypedefName = emitter.getFunctionPointerTypedefName(cSym); + if (needsLocalTypedef) { + funcPointerTypedefName = "_local_" + funcPointerTypedefName; + } String ptrVarName = "ptr_" + cSym.getName(); diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java index fe77248..45e0bf4 100755 --- a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java +++ b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java @@ -268,13 +268,15 @@ public class ProcAddressEmitter extends JavaEmitter if (shouldWrap) { // Hoist argument names from function pointer if not supplied in prototype - FunctionType typedef = typedefDictionary.get(funcPointerTypedefName).asPointer().getTargetType().asFunction(); - FunctionType fun = sym.getType(); - int numarg = typedef.getNumArguments(); - for ( int i =0; i < numarg; i++ ) - { - if ( fun.getArgumentName(i) == null ) - fun.setArgumentName(i,typedef.getArgumentName(i)); + Type funcPointerType = typedefDictionary.get(funcPointerTypedefName); + if (funcPointerType != null) { + FunctionType typedef = funcPointerType.asPointer().getTargetType().asFunction(); + FunctionType fun = sym.getType(); + int numarg = typedef.getNumArguments(); + for (int i =0; i < numarg; i++) { + if (fun.getArgumentName(i) == null) + fun.setArgumentName(i,typedef.getArgumentName(i)); + } } } |