new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
601fe97b1d
commit
7fd340e93e
2 changed files with 21 additions and 0 deletions
|
|
@ -244,6 +244,7 @@ C_TEST_CASES += \
|
||||||
defineop \
|
defineop \
|
||||||
defines \
|
defines \
|
||||||
enum \
|
enum \
|
||||||
|
function_typedef \
|
||||||
lib_carrays \
|
lib_carrays \
|
||||||
lib_cdata \
|
lib_cdata \
|
||||||
lib_cmalloc \
|
lib_cmalloc \
|
||||||
|
|
|
||||||
20
SWIG/Examples/test-suite/function_typedef.i
Normal file
20
SWIG/Examples/test-suite/function_typedef.i
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
%module function_typedef
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
typedef int binop_t(int, int);
|
||||||
|
|
||||||
|
int do_binop1(binop_t f, int x, int y) {
|
||||||
|
return f(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int do_binop2(binop_t *f, int x, int y) {
|
||||||
|
return (*f)(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int do_binop3(int f(int,int), int x, int y) {
|
||||||
|
return f(x,y);
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue