[PHP5] Change the default input typemap for char * to turn PHP

Null into C NULL (previously it was converted to an empty string).
The new behaviour is consistent with how the corresponding output
typemap works.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10864 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2008-09-18 14:02:15 +00:00
commit 16c8749768
2 changed files with 21 additions and 2 deletions

View file

@ -24,8 +24,12 @@
%enddef
%define CONVERT_STRING_IN(lvar,t,invar)
convert_to_string_ex(invar);
lvar = (t) Z_STRVAL_PP(invar);
if ((*invar)->type==IS_NULL) {
lvar = (t) 0;
} else {
convert_to_string_ex(invar);
lvar = (t) Z_STRVAL_PP(invar);
}
%enddef
%define %pass_by_val( TYPE, CONVERT_IN )