Move funcptr.i from being an R only test to a test for all languages. Modify the test to test function pointers with no arguments, which is a problem for R.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10250 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-02-13 22:41:34 +00:00
commit 9029bae5e0
3 changed files with 10 additions and 17 deletions

View file

@ -384,6 +384,7 @@ C_TEST_CASES += \
empty \
enums \
extern_declaration \
funcptr \
function_typedef \
immutable \
inctest \

View file

@ -1,18 +1,5 @@
%module funcptr
/*
Works if we use the typedef or the inline function pointer.
int (*op)(int i,int j));
*/
/*
typedef struct B (*Bar)(int i, struct C a);
typedef struct A *(*Foo)(int i, struct B a);
*/
/*
Complicated one that should defeat just reading , to find
the number of arguments expected in the function pointer.
@ -20,8 +7,7 @@ extern void do(int (*op)(int (*i)(double, double), int j));
*/
%inline %{
typedef double (*DistFun)(double* data, int r, int c, int i, int j,
void *xdata);
typedef double (*DistFun)(double* data, int r, int c, int i, int j, void *xdata);
void distance(double *data, int *dim, DistFun fun, double *output) {
}
@ -44,5 +30,11 @@ int mul(int a, int b) {
return a*b;
}
int *nowt() {
return 0;
}
int (*funcvar)(int,int) = add;
%}
int * (*funcvar2)() = nowt;
int * (*funcvar3)(void) = nowt;
%}

View file

@ -11,7 +11,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
C_TEST_CASES = copy_struct simple_array legacy
CPP_TEST_CASES = funcptr double_delete
CPP_TEST_CASES = double_delete
include $(srcdir)/../common.mk