fix typemap + numinputs +argout
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
32b724e75c
commit
523c3c6e73
3 changed files with 41 additions and 0 deletions
|
|
@ -266,6 +266,7 @@ CPP_TEST_CASES += \
|
||||||
typedef_scope \
|
typedef_scope \
|
||||||
typemap_namespace \
|
typemap_namespace \
|
||||||
typemap_ns_using \
|
typemap_ns_using \
|
||||||
|
typemap_numinputs \
|
||||||
typename \
|
typename \
|
||||||
union_scope \
|
union_scope \
|
||||||
using1 \
|
using1 \
|
||||||
|
|
|
||||||
37
SWIG/Examples/test-suite/typemap_numinputs.i
Normal file
37
SWIG/Examples/test-suite/typemap_numinputs.i
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
%module typemap_numinputs
|
||||||
|
|
||||||
|
|
||||||
|
%typemap(in, numinputs=1) (char *STR, int LEN)(int temp = 0)
|
||||||
|
{
|
||||||
|
temp = 1;
|
||||||
|
$2 = 0;
|
||||||
|
$1 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(in) (int *OUTPUT) (int temp = 0)
|
||||||
|
{
|
||||||
|
temp = 2;
|
||||||
|
$1 = &temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(argout) (int *OUTPUT)
|
||||||
|
{
|
||||||
|
temp$argnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(argout, numinputs=1) (char *STR, int LEN)
|
||||||
|
{
|
||||||
|
temp$argnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(in) int hello
|
||||||
|
{
|
||||||
|
$1 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
int this_breaks(int hello, char *STR, int LEN, int *OUTPUT)
|
||||||
|
{
|
||||||
|
return LEN;
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
@ -1418,6 +1418,9 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
|
||||||
|
|
||||||
/* Look for code fragments */
|
/* Look for code fragments */
|
||||||
Swig_typemap_emit_code_fragments(op,firstp);
|
Swig_typemap_emit_code_fragments(op,firstp);
|
||||||
|
|
||||||
|
/* increase argnum to consider numinputs */
|
||||||
|
argnum += nmatch - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue