Added test for %import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5537 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
55c4bf307f
commit
121f9b5740
7 changed files with 40 additions and 6 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
#ifndef __subdir1_hello_i__
|
#ifndef subdir1_hello_i_
|
||||||
#define __subdir1_hello_i__
|
#define subdir1_hello_i_
|
||||||
|
|
||||||
|
%{
|
||||||
|
typedef int Integer;
|
||||||
|
%}
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
|
|
@ -7,9 +11,13 @@
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Integer importtest1(Integer i) {
|
||||||
|
return i + 10;
|
||||||
|
}
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //__subdir1_hello_i__
|
#endif //subdir1_hello_i_
|
||||||
|
|
|
||||||
6
Examples/test-suite/testdir/subdir1/imports.i
Normal file
6
Examples/test-suite/testdir/subdir1/imports.i
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef subdir1_imports_i_
|
||||||
|
#define subdir1_imports_i_
|
||||||
|
|
||||||
|
typedef int Integer;
|
||||||
|
|
||||||
|
#endif //subdir1_imports_i_
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
|
// %include twice to check include header guards
|
||||||
%include "hello.i"
|
%include "hello.i"
|
||||||
%include "hello.i"
|
%include "hello.i"
|
||||||
|
%import "imports.i"
|
||||||
|
%import "imports.i"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
#ifndef __subdir2_hello_i__
|
#ifndef subdir2_hello_i_
|
||||||
#define __subdir2_hello_i__
|
#define subdir2_hello_i_
|
||||||
|
|
||||||
|
%{
|
||||||
|
typedef char * TypedefString;
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
@ -8,7 +12,12 @@
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TypedefString importtest2(TypedefString str) {
|
||||||
|
strcpy(str, "white");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
#endif //__subdir2_hello_i__
|
#endif //subdir2_hello_i_
|
||||||
|
|
|
||||||
6
Examples/test-suite/testdir/subdir2/imports.i
Normal file
6
Examples/test-suite/testdir/subdir2/imports.i
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef subdir2_imports_i_
|
||||||
|
#define subdir2_imports_i_
|
||||||
|
|
||||||
|
typedef char * TypedefString;
|
||||||
|
|
||||||
|
#endif //subdir2_imports_i_
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
%include "hello.i"
|
%include "hello.i"
|
||||||
|
%import "imports.i"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
%include "subdir1/subinc1.i"
|
%include "subdir1/subinc1.i"
|
||||||
%include "subdir2/subinc2.i"
|
%include "subdir2/subinc2.i"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue