summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--swig/Lasso.i20
1 files changed, 20 insertions, 0 deletions
diff --git a/swig/Lasso.i b/swig/Lasso.i
index 5d4c5522..5f12e070 100644
--- a/swig/Lasso.i
+++ b/swig/Lasso.i
@@ -94,6 +94,7 @@
}
%}
#else
+
#ifdef SWIGPYTHON
%{
PyObject *lassoError;
@@ -141,6 +142,25 @@ SyntaxError = _lasso.SyntaxError
#endif
+#if defined(SWIGPHP4)
+%{
+/* ZVAL_STRING segfault when s is null */
+#undef ZVAL_STRING
+#define ZVAL_STRING(z, s, duplicate) { \
+ char *__s=(s); \
+ if (__s) { \
+ (z)->value.str.len = strlen(__s); \
+ (z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):__s); \
+ } else { \
+ (z)->value.str.len = 0; \
+ (z)->value.str.val = empty_string; \
+ } \
+ (z)->type = IS_STRING; \
+ }
+%}
+#endif
+
+
#define gint int
#define guint unsigned int
#define gchar char