git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4697 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-04-21 01:34:32 +00:00
commit c1fa05651a
2 changed files with 15 additions and 0 deletions

View file

@ -267,6 +267,7 @@ C_TEST_CASES += \
preproc_3 \
preproc_4 \
preproc_5 \
preproc_6 \
ret_by_value \
sizeof_pointer \
sneaky1 \

View file

@ -0,0 +1,14 @@
%module preproc_6
#define add(a, b) (a + b)
#define times(a, b) (a * b)
#define op(x) x(1, 5)
/* expand to (1 + 5) */
%constant int a = op(add);
/* expand to (1 * 5) */
%constant int b = op(times);
/* expand to ((1 + 5) * 5) */
%constant int c = times(add(1, 5), 5);
/* expand to ((1 + 5) * 5) */
%constant int d = times(op(add), 5);