aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-10 10:53:31 +0200
committerSven Gothel <[email protected]>2023-08-10 10:53:31 +0200
commit5b6e6af3932ece0c656cf4438100f4e213ea91b6 (patch)
treec7aba1ea7f847a5acdf596aa611c2d00587eb18d /src/java/com/jogamp/gluegen
parentf8752c59945205b717c4b21ceeb4044ae9a0e9df (diff)
Bug 1450: Widen ConstantDefinition.isConstantExpression() to include 'patternCPPOperand'
i.e. all supported operands used for constant-expression of define macros.
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r--src/java/com/jogamp/gluegen/ConstantDefinition.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/ConstantDefinition.java b/src/java/com/jogamp/gluegen/ConstantDefinition.java
index d579da1..f9296a7 100644
--- a/src/java/com/jogamp/gluegen/ConstantDefinition.java
+++ b/src/java/com/jogamp/gluegen/ConstantDefinition.java
@@ -129,6 +129,7 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
return String.valueOf(f) + ( !isDouble ? "f" : "");
}
}
+ @Override
public final String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("[");
@@ -506,8 +507,9 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
}
// Find constant expressions like (1 << 3)
// if found just pass them through, they will most likely work in java too
- // expressions containing identifiers are currently ignored (casts too)
- final String[] values = value.split("[\\s\\(\\)]"); // [ whitespace '(' ')' ]
+ // expressions containing identifiers are currently ignored (casts too).
+ // The pattern includes 'patternCPPOperand', i.e. all supported operands used for constant-expression of define macros
+ final String[] values = value.split("[\\s\\+\\-\\*\\/\\|\\&\\(\\)]|(\\<\\<)|(\\>\\>)|(\\~)"); // [ whitespace '(' ')' ]
int numberCount = 0;
for (final String s : values) {
if( s.length() > 0 ) {