Date: Tue, 9 Oct 2018 12:44:06 +0000 (UTC) From: "Vanilla I. Shu" <vanilla@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r481629 - in head/devel/pecl-swoole: . files Message-ID: <201810091244.w99Ci6Q8063338@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vanilla Date: Tue Oct 9 12:44:06 2018 New Revision: 481629 URL: https://svnweb.freebsd.org/changeset/ports/481629 Log: Fix building with php73. Added: head/devel/pecl-swoole/files/patch-php7__wrapper.h (contents, props changed) head/devel/pecl-swoole/files/patch-swoole__serialize.c (contents, props changed) Modified: head/devel/pecl-swoole/Makefile head/devel/pecl-swoole/files/patch-config.m4 Modified: head/devel/pecl-swoole/Makefile ============================================================================== --- head/devel/pecl-swoole/Makefile Tue Oct 9 12:37:49 2018 (r481628) +++ head/devel/pecl-swoole/Makefile Tue Oct 9 12:44:06 2018 (r481629) @@ -3,7 +3,7 @@ PORTNAME= swoole PORTVERSION= 1.10.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel net MAINTAINER= vanilla@FreeBSD.org Modified: head/devel/pecl-swoole/files/patch-config.m4 ============================================================================== --- head/devel/pecl-swoole/files/patch-config.m4 Tue Oct 9 12:37:49 2018 (r481628) +++ head/devel/pecl-swoole/files/patch-config.m4 Tue Oct 9 12:44:06 2018 (r481629) @@ -1,6 +1,6 @@ ---- config.m4.orig 2017-09-26 08:30:45 UTC +--- config.m4.orig 2018-05-14 10:43:31 UTC +++ config.m4 -@@ -255,7 +255,7 @@ if test "$PHP_SWOOLE" != "no"; then +@@ -278,7 +278,7 @@ if test "$PHP_SWOOLE" != "no"; then AC_CHECK_LIB(c, poll, AC_DEFINE(HAVE_POLL, 1, [have poll])) AC_CHECK_LIB(c, sendfile, AC_DEFINE(HAVE_SENDFILE, 1, [have sendfile])) AC_CHECK_LIB(c, kqueue, AC_DEFINE(HAVE_KQUEUE, 1, [have kqueue])) Added: head/devel/pecl-swoole/files/patch-php7__wrapper.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pecl-swoole/files/patch-php7__wrapper.h Tue Oct 9 12:44:06 2018 (r481629) @@ -0,0 +1,14 @@ +--- php7_wrapper.h.orig 2018-10-09 11:57:28 UTC ++++ php7_wrapper.h +@@ -456,7 +456,11 @@ static inline int sw_zend_register_class + + zend_string *_interned_name = zend_new_interned_string(_name); + ++#if PHP_VERSION_ID >= 70300 ++ return zend_register_class_alias_ex(_interned_name->val, _interned_name->len, ce, 1); ++#else + return zend_register_class_alias_ex(_interned_name->val, _interned_name->len, ce); ++#endif + } + + static inline char* sw_http_build_query(zval *data, zend_size_t *length, smart_str *formstr TSRMLS_DC) Added: head/devel/pecl-swoole/files/patch-swoole__serialize.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pecl-swoole/files/patch-swoole__serialize.c Tue Oct 9 12:44:06 2018 (r481629) @@ -0,0 +1,67 @@ +--- swoole_serialize.c.orig 2018-05-14 10:43:31 UTC ++++ swoole_serialize.c +@@ -658,11 +658,17 @@ static void* swoole_unserialize_arr(void + ht->nNumUsed = nNumOfElements; + ht->nNumOfElements = nNumOfElements; + ht->nNextFreeElement = 0; ++#ifdef HASH_FLAG_APPLY_PROTECTION + ht->u.flags = HASH_FLAG_APPLY_PROTECTION; ++#endif + ht->nTableMask = -(ht->nTableSize); + ht->pDestructor = ZVAL_PTR_DTOR; + ++#if PHP_VERSION_ID < 70300 + GC_REFCOUNT(ht) = 1; ++#else ++ GC_SET_REFCOUNT(ht, 1); ++#endif + GC_TYPE_INFO(ht) = IS_ARRAY; + // if (ht->nNumUsed) + //{ +@@ -985,8 +991,9 @@ try_again: + { + zend_array *ht = Z_ARRVAL_P(data); + +- if (ZEND_HASH_GET_APPLY_COUNT(ht) > 1) ++ if (GC_IS_RECURSIVE(ht)) + { ++ ((SBucketType*) (buffer->buffer + p))->data_type = IS_NULL; //reset type null + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "you array have cycle ref"); + } + else +@@ -994,9 +1001,9 @@ try_again: + seria_array_type(ht, buffer, p, buffer->offset); + if (ZEND_HASH_APPLY_PROTECTION(ht)) + { +- ZEND_HASH_INC_APPLY_COUNT(ht); ++ GC_PROTECT_RECURSION(ht); + swoole_serialize_arr(buffer, ht); +- ZEND_HASH_DEC_APPLY_COUNT(ht); ++ GC_UNPROTECT_RECURSION(ht); + } + else + { +@@ -1022,9 +1029,9 @@ try_again: + + if (ZEND_HASH_APPLY_PROTECTION(Z_OBJPROP_P(data))) + { +- ZEND_HASH_INC_APPLY_COUNT(Z_OBJPROP_P(data)); ++ GC_PROTECT_RECURSION(Z_OBJPROP_P(data)); + swoole_serialize_object(buffer, data, p); +- ZEND_HASH_DEC_APPLY_COUNT(Z_OBJPROP_P(data)); ++ GC_UNPROTECT_RECURSION(Z_OBJPROP_P(data)); + } + else + { +@@ -1405,7 +1412,11 @@ PHPAPI zend_string* php_swoole_serialize + z_str->val[str.offset] = '\0'; + z_str->len = str.offset - _STR_HEADER_SIZE; + z_str->h = 0; ++#if PHP_VERSION_ID < 70300 + GC_REFCOUNT(z_str) = 1; ++#else ++ GC_SET_REFCOUNT(z_str, 1); ++#endif + GC_TYPE_INFO(z_str) = IS_STRING_EX; + + return z_str;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810091244.w99Ci6Q8063338>