diff options
author | Sven Gothel <[email protected]> | 2009-08-05 07:31:49 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-08-05 07:31:49 -0700 |
commit | aac675e3ae8be73d3e498cc8f1062a20839f8482 (patch) | |
tree | dbf68c2183499179a28632b2d3dbc491e0f225dd /src/java/com/sun/gluegen/pcpp/PCPP.java | |
parent | edaf82f5a86cd3e239072608e5299a9553ece32c (diff) |
Cleanup for a better OpenGL 3.2 integration,
for subsuming extensions:
- Allow RenameExtensionIntoCore generate duplicate names,
ie those will not be generated.
- Add proper comment showing the extension of the symbol.
- Fail if no 'GLHeader' is specified, but we are processing a GL/ProcAddress config
- Fail if a GL function is not part of an extension
MethodBinding, ConstantDefinition cleanup:
- getName() returns the renamed name
- getOrigName() returns the original
- getAliasedNames() returns the aliased ones
MethodBinding:
- Change: equals() operates on renamed name
- Add: hashCode() function - same criteria as equals()
Impact:
- All config options etc shall trigger with the renamed name,
but ignore, rename etc.
- Generated Java impl. uses the renamed base name as well
Change: emitDefine() uses the ConstantDefinition
Add: JavaConfiguration: dumpRenames()
Change JavaConfiguration.shouldIgnoreInInterface/Impl():
- respect the renamed symbol name as well
Change JavaEmitter.emitFunctions():
- only emit a generated MethodBinding once,
therefor store emitted method bindings in a HashSet
Fix BuildStaticGLInfo:
- Allow white space at the end of #ifndef and #define
- Trim strings
- Allow 'const' qualifier in function pattern
Fix GLEmitter:
- Fail if no 'GLHeader' is specified, but a RenameIntoCore option ..
- Don't emit marker defines, marking an extension (ie not part of an extension)
Fix GLJavaMethodBindingEmitter:
- Fail if a GL function is not part of an extension
Fix PCPP:
- Pass constant type qualifiers for hex-constants: 'l' 'L' ...
Fix ProcAddressEmitter:
- Operate on the aliased/renamed name for querying ProcAddress usage
and generating code.
Diffstat (limited to 'src/java/com/sun/gluegen/pcpp/PCPP.java')
-rw-r--r-- | src/java/com/sun/gluegen/pcpp/PCPP.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/java/com/sun/gluegen/pcpp/PCPP.java b/src/java/com/sun/gluegen/pcpp/PCPP.java index 4523032..7303c04 100644 --- a/src/java/com/sun/gluegen/pcpp/PCPP.java +++ b/src/java/com/sun/gluegen/pcpp/PCPP.java @@ -436,8 +436,10 @@ public class PCPP { System.err.println("WARNING: \"" + name + "\" redefined from \"" + oldDef + "\" to \"" + value + "\""); } + debugPrint(true, "#define " + name + " ["+oldDef+" ] -> "+value + " CONST"); //System.out.println("//---DEFINED: " + name + " to \"" + value + "\""); } else { + debugPrint(true, "#define " + name + " -> "+value + " SYMB"); // Value is a symbolic constant like "#define FOO BAR". // Try to look up the symbol's value String newValue = resolveDefine(value, true); @@ -501,15 +503,25 @@ public class PCPP { } private boolean checkHex(String s) { - for (int i = 2; i < s.length(); i++) { - char c = s.charAt(i); + char c='\0'; + int i; + for (i = 2; i < s.length(); i++) { + c = s.charAt(i); if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) { - return false; + break; } } - return true; + if(i==s.length()) { + return true; + } else if(i==s.length()-1) { + // Const qualifier .. + return c == 'l' || c == 'L' || + c == 'f' || c == 'F' || + c == 'u' || c == 'U' ; + } + return false; } private boolean checkDecimal(String s) { @@ -553,7 +565,7 @@ public class PCPP { String symbolName = nextWord(); debugPrint(true, (isIfdef ? "#ifdef " : "#ifndef ") + symbolName); boolean symbolIsDefined = defineMap.get(symbolName) != null; - //debugPrint(true, "HANDLE_IFDEF: ifdef(" + symbolName + ") = " + symbolIsDefined ); + debugPrint(true, (isIfdef ? "#ifdef " : "#ifndef ") + symbolName + "(defined: "+symbolIsDefined+")"); pushEnableBit(enabled() && symbolIsDefined == isIfdef); } @@ -808,7 +820,7 @@ public class PCPP { private void pushEnableBit(boolean enabled) { enabledBits.add(new Boolean(enabled)); ++debugPrintIndentLevel; - //debugPrint(false, "PUSH_ENABLED, NOW: " + enabled()); + debugPrint(false, "PUSH_ENABLED, NOW: " + enabled()); } private void popEnableBit() { @@ -818,7 +830,7 @@ public class PCPP { } enabledBits.remove(enabledBits.size() - 1); --debugPrintIndentLevel; - //debugPrint(false, "POP_ENABLED, NOW: " + enabled()); + debugPrint(false, "POP_ENABLED, NOW: " + enabled()); } private boolean enabled() { |