summaryrefslogtreecommitdiff
path: root/Examples/test-suite/preproc_defined.h
blob: 1e60ca1166baaa8d559c74500c4ae88c1a76bd4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * This should not compile in when this bug is present
 * https://github.com/swig/swig/issues/2525
 */

#define my_bad_attr __attribute__
#define my_good_attr(x) __attribute__(x)

int bad my_bad_attr((used));
int good my_good_attr((used));

/*
 * The behaviour of Self-Referential Macros is defined
 * https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Self-Referential-Macros.html
 */
int y = 0;

#define x (4 + y)
#define y (2 * x)

int z = y;