summaryrefslogtreecommitdiff
path: root/Examples/test-suite/cpp14_binary_integer_literals.i
blob: 9c696b5a5a8992820316879301af76e7a8b6f3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%module cpp14_binary_integer_literals

// Tests are designed so that code compiles with C++98 compilers

%{
#if __cplusplus >= 201402L
#define CPP14 1
#endif
%}

int b1 = 0b1;
int b2 = 0b10;
long b3 = 0b11l;
unsigned long b4 = 0b100ul;
unsigned long b5 = 0B101UL;

%{
#if defined(CPP14)
int b1 = 0b1;
int b2 = 0b10;
long b3 = 0b11l;
unsigned long b4 = 0b100ul;
unsigned long b5 = 0B101UL;
#else
int b1 = 1;
int b2 = 2;
long b3 = 3;
unsigned long b4 = 4;
unsigned long b5 = 5;
#endif
%}