Added broken example with cpp macro expansion
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4288 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8bdec0c0a9
commit
1557e4da35
2 changed files with 40 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ DYNAMIC_LIB_PATH = $(RUNTIMEDIR):.
|
|||
|
||||
# Broken C++ test cases. (Can be run individually using make testcase.cpptest.)
|
||||
CPP_TEST_BROKEN += \
|
||||
preproc_4 \
|
||||
cast_operator \
|
||||
arrayref \
|
||||
abstract_typedef \
|
||||
|
|
|
|||
39
SWIG/Examples/test-suite/preproc_4.i
Normal file
39
SWIG/Examples/test-suite/preproc_4.i
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
%module preproc_4
|
||||
|
||||
%{
|
||||
inline int hello0()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline int hello1()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int hello2()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
%}
|
||||
|
||||
#define ARITH_RTYPE(A1, A2) A2
|
||||
|
||||
#define HELLO_TYPE(A, B) ARITH_RTYPE(A, ARITH_RTYPE(A,B))
|
||||
|
||||
|
||||
//
|
||||
// These two work fine
|
||||
//
|
||||
int hello0();
|
||||
ARITH_RTYPE(double,int) hello1();
|
||||
|
||||
|
||||
|
||||
//
|
||||
// This doesn't work with 1.3.17+ ( but it was ok in 1.3.16 )
|
||||
// it gets expanded as (using -E)
|
||||
//
|
||||
// ARITH_RTYPE(double,int) hello2();
|
||||
//
|
||||
HELLO_TYPE(double,int) hello2();
|
||||
Loading…
Add table
Add a link
Reference in a new issue