1 %module enum_macro
2 
3 %inline %{
4 
5 #if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
6 /* comma at end of enumerator list [-Werror=pedantic] */
7 #pragma GCC diagnostic ignored "-Wpedantic"
8 #endif
9 
10 
11 enum Greeks1
12 {
13 #define GREEK1 -1
14     alpha1=1,
15     beta1,
16     theta1
17 };
18 
19 enum Greeks2
20 {
21     alpha2 = 2,
22 #define GREEK2 -2
23     beta2,
24     theta2
25 };
26 
27 enum Greeks3
28 {
29     alpha3,
30     beta3,
31 #define GREEK3 -3
32     theta3
33 };
34 
35 enum Greeks4
36 {
37     alpha4 = 4,
38     beta4 = 5,
39     theta4 = 6
40 #define GREEK4 -4
41 };
42 
43 enum Greeks5
44 {
45 #define GREEK5 -5
46     alpha5,
47     beta5,
48 };
49 
50 enum Greeks6
51 {
52     alpha6,
53 #define GREEK6 -6
54     beta6,
55 };
56 
57 enum Greeks7
58 {
59     alpha7,
60     beta7,
61 #define GREEK7 -7
62 };
63 
64 enum Greeks8
65 {
66 #define GREEK8 -8
67     theta8
68 };
69 
70 enum Greeks9
71 {
72     theta9
73 #define GREEK9 -9
74 };
75 
76 enum Greeks10
77 {
78 #define GREEK10 -10
79     theta10,
80 };
81 
82 enum Greeks11
83 {
84     theta11,
85 #define GREEK11 -11
86 };
87 
88 typedef enum {
89     theta12 = 0
90 #define GREEK12 -12
91 } Greeks12;
92 %}
93 
94 
95 enum Greeks13
96 {
97 #define GREEK13 -13
98 };
99 
100 /* Multiple macros */
101 
102 %inline %{
103 enum Greeks14
104 {
105 #define GREEK14a -14
106 #define GREEK14b -140
107     theta14,
108 };
109 
110 enum Greeks15
111 {
112     alpha15 = 150,
113     beta15 = 151,
114 #define GREEK15a -150
115 #define GREEK15b -151
116     theta15 = 152,
117     delta15 = 153
118 };
119 
120 enum Greeks16
121 {
122     alpha16 = 160,
123     beta16 = 161,
124 #define GREEK16a -160
125 #define GREEK16b -161
126 #define GREEK16c -162
127     theta16 = 162,
128     delta16 = 163
129 };
130 
131 enum Greeks17
132 {
133     alpha17 = 170,
134     beta17 = 171,
135     theta17 = 172,
136     delta17 = 173
137 #define GREEK17a -170
138 #define GREEK17b -171
139 #define GREEK17c -172
140 };
141 %}
142