add php typecheck typemaps for const reference for primitives
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11551 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d2316a8189
commit
42d7f3bb10
2 changed files with 6 additions and 7 deletions
|
|
@ -4,7 +4,7 @@ require "tests.php";
|
||||||
require "director_string.php";
|
require "director_string.php";
|
||||||
|
|
||||||
// No new functions
|
// No new functions
|
||||||
check::functions(array(a_get_first,a_call_get_first,a_string_length,a_process_text,a_call_process_func,stringvector_size,stringvector_is_empty,stringvector_clear,stringvector_push,stringvector_pop));
|
check::functions(array(a_get_first,a_call_get_first,a_string_length,a_process_text,a_call_process_func,stringvector_size,stringvector_is_empty,stringvector_clear,stringvector_push,stringvector_pop,stringvector_capacity,stringvector_reserve));
|
||||||
// No new classes
|
// No new classes
|
||||||
check::classes(array(A,StringVector));
|
check::classes(array(A,StringVector));
|
||||||
// now new vars
|
// now new vars
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@
|
||||||
// an argument to be converted from a different PHP type, you must convert
|
// an argument to be converted from a different PHP type, you must convert
|
||||||
// it yourself before passing it (e.g. (string)4.7 or (int)"6").
|
// it yourself before passing it (e.g. (string)4.7 or (int)"6").
|
||||||
%define %php_typecheck(_type,_prec,is)
|
%define %php_typecheck(_type,_prec,is)
|
||||||
%typemap(typecheck,precedence=_prec) _type
|
%typemap(typecheck,precedence=_prec) _type, const _type &
|
||||||
" $1 = (Z_TYPE_PP($input) == is); "
|
" $1 = (Z_TYPE_PP($input) == is); "
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
@ -342,13 +342,12 @@
|
||||||
%php_typecheck(size_t,SWIG_TYPECHECK_INT16,IS_LONG)
|
%php_typecheck(size_t,SWIG_TYPECHECK_INT16,IS_LONG)
|
||||||
%php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INT8,IS_LONG)
|
%php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INT8,IS_LONG)
|
||||||
%php_typecheck(bool,SWIG_TYPECHECK_BOOL,IS_BOOL)
|
%php_typecheck(bool,SWIG_TYPECHECK_BOOL,IS_BOOL)
|
||||||
|
|
||||||
%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING)
|
|
||||||
%php_typecheck(char *,SWIG_TYPECHECK_STRING,IS_STRING)
|
|
||||||
%php_typecheck(char [],SWIG_TYPECHECK_STRING,IS_STRING)
|
|
||||||
|
|
||||||
%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE)
|
%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE)
|
||||||
%php_typecheck(double,SWIG_TYPECHECK_BOOL,IS_DOUBLE)
|
%php_typecheck(double,SWIG_TYPECHECK_BOOL,IS_DOUBLE)
|
||||||
|
%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING)
|
||||||
|
|
||||||
|
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, const char *&, char []
|
||||||
|
" $1 = (Z_TYPE_PP($input) == IS_STRING); "
|
||||||
|
|
||||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
|
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue