PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/preproc_include.i

#
Swig | 52 lines | 39 code | 13 blank | 0 comment | 0 complexity | ec3bd9b738185688642f86a02e7a5de7 MD5 | raw file
 1%module preproc_include
 2
 3%{
 4#include "preproc_include_a.h"
 5#include "preproc_include_b.h"
 6int multiply10(int a) { return a*10; }
 7int multiply20(int a) { return a*20; }
 8int multiply30(int a) { return a*30; }
 9int multiply40(int a) { return a*40; }
10int multiply50(int a) { return a*50; }
11%}
12
13#define INCLUDE_B preproc_include_b.h
14#define FILE_INCLUDE(FNAME) #FNAME
15
16%include FILE_INCLUDE(preproc_include_a.h)
17
18// Note that this test uses -includeall, so including preproc_include_b.h also includes preproc_include_c.h
19%include INCLUDE_B
20
21%include"preproc_include_d withspace.h"
22
23#define INCLUDE_E "preproc_include_e withspace.h"
24
25%include INCLUDE_E
26
27%inline %{
28#define INCLUDE_F /*comments*/ "preproc_include_f withspace.h"/*testing*/
29#include INCLUDE_F
30#include /*oooo*/"preproc_include_g.h"/*ahhh*/
31%}
32
33%{
34int multiply60(int a) { return a*60; }
35int multiply70(int a) { return a*70; }
36%}
37
38%define nested_include_1(HEADER)
39%include <HEADER>
40%enddef
41
42%define nested_include_2(HEADER)
43nested_include_1(HEADER);
44%enddef
45
46%define nested_include_3(HEADER)
47nested_include_2(HEADER);
48%enddef
49
50nested_include_1(preproc_include_h1.i);
51nested_include_2(preproc_include_h2.i);
52nested_include_3(preproc_include_h3.i);