Switch typechecks for simple data types to allow conversion.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7455 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e40a114246
commit
9c1a6a85f3
1 changed files with 9 additions and 1 deletions
|
|
@ -222,9 +222,17 @@
|
||||||
RETVAL_STRINGL($1,len,1);
|
RETVAL_STRINGL($1,len,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This typecheck would do hard checking for proper argument type.
|
||||||
|
//%define %php_typecheck(_type,_prec,is)
|
||||||
|
//%typemap(typecheck,precedence=_prec) _type
|
||||||
|
// " $1 = Z_TYPE_PP($input) == is ? 1 : 0; "
|
||||||
|
//%enddef
|
||||||
|
|
||||||
%define %php_typecheck(_type,_prec,is)
|
%define %php_typecheck(_type,_prec,is)
|
||||||
%typemap(typecheck,precedence=_prec) _type
|
%typemap(typecheck,precedence=_prec) _type
|
||||||
" $1 = Z_TYPE_PP($input) == is ? 1 : 0; "
|
" $1 = (Z_TYPE_PP($input) == IS_LONG ||
|
||||||
|
Z_TYPE_PP($input) == IS_DOUBLE ||
|
||||||
|
Z_TYPE_PP($input) == IS_STRING) ? 1 : 0; "
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG)
|
%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue