summaryrefslogtreecommitdiff
path: root/Lib/php
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2021-03-18 10:53:58 +1300
committerOlly Betts <ojwbetts@gmail.com>2021-03-19 08:34:15 +1300
commitb7dedecfdd708c5323addc1b28e16cc727e01980 (patch)
treeef6e098b7c3a7a349c29f8a8349d945d33217f0a /Lib/php
parent157465f65be14d38f078dcd6a848426f2eecfc81 (diff)
downloadswig-b7dedecfdd708c5323addc1b28e16cc727e01980.tar.gz
php: Fix char* typecheck typemap to accept Null
The corresponding in typemap already does. Fixes #1655, reported by CJSlominski.
Diffstat (limited to 'Lib/php')
-rw-r--r--Lib/php/php.swg5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/php/php.swg b/Lib/php/php.swg
index 4eba6be2a..ccfd371ab 100644
--- a/Lib/php/php.swg
+++ b/Lib/php/php.swg
@@ -465,7 +465,10 @@
%php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE)
%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING)
-%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *&, char []
+%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *&
+ " $1 = (Z_TYPE($input) == IS_STRING || Z_TYPE($input) == IS_NULL); "
+
+%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char []
" $1 = (Z_TYPE($input) == IS_STRING); "
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE