From 7fd340e93e7eb4f857116c2f58fe35ba6f6bdbcf Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 17 Mar 2003 17:56:53 +0000 Subject: [PATCH] new test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4562 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/test-suite/common.mk | 1 + SWIG/Examples/test-suite/function_typedef.i | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 SWIG/Examples/test-suite/function_typedef.i diff --git a/SWIG/Examples/test-suite/common.mk b/SWIG/Examples/test-suite/common.mk index 84dc6ab5e..590f2b727 100644 --- a/SWIG/Examples/test-suite/common.mk +++ b/SWIG/Examples/test-suite/common.mk @@ -244,6 +244,7 @@ C_TEST_CASES += \ defineop \ defines \ enum \ + function_typedef \ lib_carrays \ lib_cdata \ lib_cmalloc \ diff --git a/SWIG/Examples/test-suite/function_typedef.i b/SWIG/Examples/test-suite/function_typedef.i new file mode 100644 index 000000000..718af9c2f --- /dev/null +++ b/SWIG/Examples/test-suite/function_typedef.i @@ -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); +} +%} + +