summaryrefslogtreecommitdiff
path: root/Lib/python/pystrbase.swg
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/python/pystrbase.swg')
-rw-r--r--Lib/python/pystrbase.swg9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/python/pystrbase.swg b/Lib/python/pystrbase.swg
index ed787d51f..16df6d938 100644
--- a/Lib/python/pystrbase.swg
+++ b/Lib/python/pystrbase.swg
@@ -137,8 +137,7 @@
%apply Char* { Char [] };
%apply const Char* { const Char [] };
-%typemap(varin,fragment=#SWIG_AsCharArray,
- warning="462:Unable to set variable of type Char []") Char []
+%typemap(varin,warning="462:Unable to set variable of type Char []") Char []
{
PyErr_SetString(PyExc_AttributeError, "C/C++ variable '$name' is read-only");
return 1;
@@ -173,6 +172,12 @@
$1 = temp;
}
+%typemap(in,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0])
+{
+ if (!SWIG_AsCharArray($input, temp, $1_dim0)) {SWIG_arg_fail($argnum);SWIG_fail;}
+ $1 = &temp;
+}
+
%typemap(out,fragment=#SWIG_FromCharArray)
Char [ANY], const Char[ANY]
{