diff --git a/CHANGES.current b/CHANGES.current index 2fd55ba86..09f2500b9 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.1 (in progress) =========================== +2014-04-02: olly + [PHP] Pass ZTS context through to t_output_helper() so it works + with a ZTS-enabled build of PHP. Reported by Pierre Labastie in + github PR#155. + 2014-03-28: wsfulton [Java C# D Go] Fixes for C enums used in an API and the definition of the enum has not been parsed. For D, this fixes a segfault in SWIG. The other languages diff --git a/Lib/php/typemaps.i b/Lib/php/typemaps.i index 9fd73fe1c..ca49ec327 100644 --- a/Lib/php/typemaps.i +++ b/Lib/php/typemaps.i @@ -38,7 +38,7 @@ zval *o; MAKE_STD_ZVAL(o); ZVAL_BOOL(o,temp$argnum); - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in) TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) %{ @@ -67,7 +67,7 @@ zval *o; MAKE_STD_ZVAL(o); ZVAL_DOUBLE(o,temp$argnum); - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in) TYPE *REFERENCE (TYPE dvalue), TYPE &REFERENCE (TYPE dvalue) %{ @@ -96,7 +96,7 @@ zval *o; MAKE_STD_ZVAL(o); ZVAL_LONG(o,temp$argnum); - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in) TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) %{ @@ -137,7 +137,7 @@ INT_TYPEMAP(long long); sprintf(temp, "%lld", (long long)temp$argnum); ZVAL_STRING(o, temp, 1); } - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in) TYPE *REFERENCE (long long lvalue) %{ @@ -178,7 +178,7 @@ INT_TYPEMAP(unsigned long long); sprintf(temp, "%llu", (unsigned long long)temp$argnum); ZVAL_STRING(o, temp, 1); } - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in) TYPE *REFERENCE (unsigned long long lvalue) %{ @@ -276,12 +276,12 @@ INT_TYPEMAP(unsigned long long); %} %typemap(in,numinputs=0) char OUTPUT[ANY] ( char temp[$1_dim0] ) "$1 = temp;"; -%typemap(argout) char OUTPUT[ANY] +%typemap(argout,fragment="t_output_helper") char OUTPUT[ANY] { zval *o; MAKE_STD_ZVAL(o); ZVAL_STRINGL(o,temp$argnum,$1_dim0); - t_output_helper( &$result, o ); + t_output_helper( &$result, o TSRMLS_CC ); } %typemap(in,numinputs=0) void **OUTPUT (int force), diff --git a/Lib/php/utils.i b/Lib/php/utils.i index c3b19a320..4e53e25a7 100644 --- a/Lib/php/utils.i +++ b/Lib/php/utils.i @@ -91,7 +91,7 @@ %fragment("t_output_helper","header") %{ static void -t_output_helper( zval **target, zval *o) { +t_output_helper(zval **target, zval *o TSRMLS_DC) { if ( (*target)->type == IS_ARRAY ) { /* it's already an array, just append */ add_next_index_zval( *target, o );