From: Olly B. <ol...@us...> - 2006-09-20 06:59:12
|
Update of /cvsroot/swig/SWIG/Lib/php4 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24254/Lib/php4 Modified Files: php4.swg php4run.swg Log Message: Overload resolution now works in PHP out of the box. Index: php4run.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/php4/php4run.swg,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** php4run.swg 20 Sep 2006 06:37:50 -0000 1.19 --- php4run.swg 20 Sep 2006 06:59:07 -0000 1.20 *************** *** 160,164 **** if ((*_cPtr)->type==IS_RESOURCE) { *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC); ! return (ptr == NULL ? -1 : 0); } } --- 160,164 ---- if ((*_cPtr)->type==IS_RESOURCE) { *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC); ! return (*ptr == NULL ? -1 : 0); } } *************** *** 167,171 **** case IS_RESOURCE: *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC); ! return (ptr == NULL ? -1 : 0); case IS_NULL: *ptr = 0; --- 167,171 ---- case IS_RESOURCE: *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC); ! return (*ptr == NULL ? -1 : 0); case IS_NULL: *ptr = 0; Index: php4.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/php4/php4.swg,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** php4.swg 4 Jul 2006 21:02:54 -0000 1.26 --- php4.swg 20 Sep 2006 06:59:07 -0000 1.27 *************** *** 230,244 **** } ! // 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) %typemap(typecheck,precedence=_prec) _type ! " $1 = (Z_TYPE_PP($input) == IS_LONG || ! Z_TYPE_PP($input) == IS_DOUBLE || ! Z_TYPE_PP($input) == IS_STRING) ? 1 : 0; " %enddef --- 230,239 ---- } ! // This typecheck does hard checking for proper argument type. If you want ! // 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"). %define %php_typecheck(_type,_prec,is) %typemap(typecheck,precedence=_prec) _type ! " $1 = (Z_TYPE_PP($input) == is); " %enddef *************** *** 270,278 **** { void *tmp; ! _v = (SWIG_ConvertPtr( *$input, (void**)&tmp, $1_descriptor, 0) < 0)? 0:1; } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * ! " /* tyepcheck void * */ " --- 265,273 ---- { void *tmp; ! _v = (SWIG_ConvertPtr( *$input, (void**)&tmp, $1_descriptor, 0) >= 0); } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * ! " /* typecheck void * */ " |