1
%module preproc_line_file
3
// Test __LINE__ and __FILE__ (don't change line numbering in here else runtime tests will need modifying)
4
#define MYLINE __LINE__
5
#define MYLINE_ADJUSTED __LINE__ + 100
7
#define MYFILE __FILE__
8
#define MYFILE_ADJUSTED __FILE__ ".bak"
11
#define STRINGNUM_HELP(a,b) #a#b
12
#define STRINGNUM(a,b) STRINGNUM_HELP(a,b)
13
#define STRINGNUM_UNIQUE(a) STRINGNUM(a,__LINE__)
15
#define MY_STRINGNUM_A STRINGNUM_UNIQUE(my)
16
#define MY_STRINGNUM_B STRINGNUM_UNIQUE(my)
19
#define NUMBER_HELP(a,b) a##b
20
#define NUMBER(a,b) NUMBER_HELP(a,b)
21
#define NUMBER_UNIQUE(a) NUMBER(a,__LINE__)
24
const int thing27 = -1;
25
const int thing28 = -2;
27
const int NUMBER_UNIQUE(thing) = -1; /* resolves to thing27 */
28
const int NUMBER_UNIQUE(thing) = -2; /* resolves to thing28 */
30
#define MYLINE2 __LINE__
32
#if defined (SWIGJAVA)
34
#elif defined(SWIGCSHARP)
47
/* static const int line_num = __LINE__; */
52
static const int LINE_NUMBER = __LINE__; /* This is a C test case, but we can still use a C++ feature to wrap a constant to test __LINE__ here */
55
#define SILLY_CLASS struct SillyMacroClass { int num; static const int LINE_NUM = __LINE__; };
59
#define SILLY_CLASS struct SillyMacroClass { int num; };
68
static const int LINE_NUM = __LINE__;
81
KLASS(SillyMultipleMacroStruct)
86
#define INLINE_FILE __FILE__
87
#define INLINE_LINE __LINE__
90
#define MACRO_END_WITH_SLASH ABCD/