summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/gluegen/ConstantDefinition.java4
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java9
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/test1.h8
3 files changed, 19 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/ConstantDefinition.java b/src/java/com/jogamp/gluegen/ConstantDefinition.java
index 675c6d7..d579da1 100644
--- a/src/java/com/jogamp/gluegen/ConstantDefinition.java
+++ b/src/java/com/jogamp/gluegen/ConstantDefinition.java
@@ -760,7 +760,7 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
public final static Pattern patternIntegerNumber;
/**
- * One of: {@code +} {@code -} {@code *} {@code /} {@code |} {@code &} {@code (} {@code )} {@code <<} {@code >>}
+ * One of: {@code +} {@code -} {@code *} {@code /} {@code |} {@code &} {@code (} {@code )} {@code <<} {@code >>} {@code ~}
* <p>
* Expression excludes {@link #patternDecimalOrIntNumber}.
* </p>
@@ -949,6 +949,6 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
")" +
WhiteSpace // Optional trailing "whitespace"
;
- patternCPPOperand = Pattern.compile("(?!"+fpOrIntRegex2+")[\\+\\-\\*\\/\\|\\&\\(\\)]|(\\<\\<)|(\\>\\>)");
+ patternCPPOperand = Pattern.compile("(?!"+fpOrIntRegex2+")[\\+\\-\\*\\/\\|\\&\\(\\)]|(\\<\\<)|(\\>\\>)|(\\~)");
}
}
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
index ed23f54..d87053f 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
@@ -246,6 +246,15 @@ public class BaseClass extends SingletonJunitCase {
Assert.assertEquals( 9, Bindingtest1.NUMBER_NINE);
Assert.assertEquals( 10, Bindingtest1.NUMBER_TEN);
+ // Bitwise not Expression
+ Assert.assertEquals(~ Bindingtest1.NUMBER_ONE, Bindingtest1.BITWISE_NOT_OF_ONE);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_TWO, Bindingtest1.BITWISE_NOT_OF_TWO);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_FOUR, Bindingtest1.BITWISE_NOT_OF_FOUR);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_FIVE, Bindingtest1.BITWISE_NOT_OF_FIVE);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_EIGHT, Bindingtest1.BITWISE_NOT_OF_EIGHT);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_NINE, Bindingtest1.BITWISE_NOT_OF_NINE);
+ Assert.assertEquals(~ Bindingtest1.NUMBER_TEN, Bindingtest1.BITWISE_NOT_OF_TEN);
+
// Enum Constant Expressions!
Assert.assertEquals( 1, Bindingtest1.ENUM_NUM_ONE);
Assert.assertEquals( 2, Bindingtest1.ENUM_NUM_TWO);
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h
index 89848d7..6e1f8db 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h
@@ -114,6 +114,14 @@ enum CL_INT { ENUM_I0=10, ENUM_I1, ENUM_I2=+12U, ENUM_I3=0x0d, ENUM_I4=-14, ENUM
#define NUMBER_NINE ( 2 * 2 + ( 1 << 2 ) + 1 )
#define NUMBER_TEN ( NUMBER_EIGHT | NUMBER_TWO )
+#define BITWISE_NOT_OF_ONE ~ NUMBER_ONE
+#define BITWISE_NOT_OF_TWO ~ NUMBER_TWO
+#define BITWISE_NOT_OF_FOUR ~ NUMBER_FOUR
+#define BITWISE_NOT_OF_FIVE ~ NUMBER_FIVE
+#define BITWISE_NOT_OF_EIGHT ~ NUMBER_EIGHT
+#define BITWISE_NOT_OF_NINE ~ NUMBER_NINE
+#define BITWISE_NOT_OF_TEN ~ NUMBER_TEN
+
enum NumberOps { ENUM_NUM_ONE = CONSTANT_ONE,
ENUM_NUM_TWO = 1+1,
ENUM_NUM_THREE,