Date: Sun, 14 Oct 2018 16:28:28 +0000 (UTC) From: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r482057 - in head/databases/php7-tarantool: . files Message-ID: <201810141628.w9EGSSme006726@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sunpoet Date: Sun Oct 14 16:28:27 2018 New Revision: 482057 URL: https://svnweb.freebsd.org/changeset/ports/482057 Log: Fix build with PHP 7.3 Added: head/databases/php7-tarantool/files/ head/databases/php7-tarantool/files/patch-src-tarantool.c (contents, props changed) head/databases/php7-tarantool/files/patch-src-tarantool_msgpack.c (contents, props changed) head/databases/php7-tarantool/files/patch-src-utils.c (contents, props changed) Modified: head/databases/php7-tarantool/Makefile Modified: head/databases/php7-tarantool/Makefile ============================================================================== --- head/databases/php7-tarantool/Makefile Sun Oct 14 16:28:19 2018 (r482056) +++ head/databases/php7-tarantool/Makefile Sun Oct 14 16:28:27 2018 (r482057) @@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES= php:ext CONFIGURE_ARGS= --with-tarantool -IGNORE_WITH_PHP=56 73 +IGNORE_WITH_PHP=56 USE_GITHUB= yes GH_PROJECT= ${PORTNAME}-php Added: head/databases/php7-tarantool/files/patch-src-tarantool.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/php7-tarantool/files/patch-src-tarantool.c Sun Oct 14 16:28:27 2018 (r482057) @@ -0,0 +1,14 @@ +--- src/tarantool.c.orig 2018-04-18 13:33:56 UTC ++++ src/tarantool.c +@@ -1151,7 +1151,11 @@ PHP_METHOD(Tarantool, __construct) { + memset(&le, 0, sizeof(zend_resource)); + le.type = php_tarantool_list_entry(); + le.ptr = obj; ++#if PHP_VERSION_ID >= 70300 ++ GC_SET_REFCOUNT(&le, 1); ++#else + GC_REFCOUNT(&le) = 1; ++#endif + + assert(plist_id != NULL); + if (zend_hash_update_mem(&EG(persistent_list), plist_id, Added: head/databases/php7-tarantool/files/patch-src-tarantool_msgpack.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/php7-tarantool/files/patch-src-tarantool_msgpack.c Sun Oct 14 16:28:27 2018 (r482057) @@ -0,0 +1,122 @@ +--- src/tarantool_msgpack.c.orig 2018-04-18 13:33:56 UTC ++++ src/tarantool_msgpack.c +@@ -123,15 +123,30 @@ void php_mp_pack_array_recursively(smart + for (; key_index < n; ++key_index) { + data = zend_hash_index_find(ht, key_index); + if (!data || data == val || (Z_TYPE_P(data) == IS_ARRAY && ++#if PHP_VERSION_ID >= 70300 ++ !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE) && ++ GC_IS_RECURSIVE(Z_ARRVAL_P(data)))) { ++#else + ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data)) && + Z_ARRVAL_P(data)->u.v.nApplyCount > 1)) { ++#endif + php_mp_pack_nil(str); + } else { ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_PROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount++; ++#endif + php_mp_pack(str, data); ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_UNPROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount--; ++#endif + } + } + } +@@ -166,15 +181,30 @@ void php_mp_pack_hash_recursively(smart_ + } + data = zend_hash_get_current_data_ex(ht, &pos); + if (!data || data == val || (Z_TYPE_P(data) == IS_ARRAY && ++#if PHP_VERSION_ID >= 70300 ++ !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE) && ++ GC_IS_RECURSIVE(Z_ARRVAL_P(data)))) { ++#else + ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data)) && + Z_ARRVAL_P(data)->u.v.nApplyCount > 1)) { ++#endif + php_mp_pack_nil(str); + } else { ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_PROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount++; ++#endif + php_mp_pack(str, data); ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_UNPROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount--; ++#endif + } + } + } +@@ -408,14 +438,28 @@ size_t php_mp_sizeof_array_recursively(z + for (; key_index < n; ++key_index) { + data = zend_hash_index_find(ht, key_index); + if (!data || data == val || ++#if PHP_VERSION_ID >= 70300 ++ (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE) && GC_IS_RECURSIVE(Z_ARRVAL_P(data)))) { ++#else + (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data)) && Z_ARRVAL_P(data)->u.v.nApplyCount > 1)) { ++#endif + needed += php_mp_sizeof_nil(); + } else { ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_PROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount++; ++#endif + needed += php_mp_sizeof(data); ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_UNPROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount--; ++#endif + } + } + return needed; +@@ -452,14 +496,28 @@ size_t php_mp_sizeof_hash_recursively(zv + } + data = zend_hash_get_current_data_ex(ht, &pos); + if (!data || data == val || ++#if PHP_VERSION_ID >= 70300 ++ (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE) && GC_IS_RECURSIVE(Z_ARRVAL_P(data)))) { ++#else + (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data)) && Z_ARRVAL_P(data)->u.v.nApplyCount > 1)) { ++#endif + needed += php_mp_sizeof_nil(); + } else { ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_PROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount++; ++#endif + needed += php_mp_sizeof(data); ++#if PHP_VERSION_ID >= 70300 ++ if (Z_TYPE_P(data) == IS_ARRAY && !(GC_FLAGS(Z_ARRVAL_P(data)) & GC_IMMUTABLE)) ++ GC_UNPROTECT_RECURSION(Z_ARRVAL_P(data)); ++#else + if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) + Z_ARRVAL_P(data)->u.v.nApplyCount--; ++#endif + } + } + return needed; Added: head/databases/php7-tarantool/files/patch-src-utils.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/php7-tarantool/files/patch-src-utils.c Sun Oct 14 16:28:27 2018 (r482057) @@ -0,0 +1,13 @@ +--- src/utils.c.orig 2018-04-18 13:33:56 UTC ++++ src/utils.c +@@ -29,8 +29,10 @@ const char *tutils_op_to_string(zval *ob + return "RESOURCE"; + case(IS_REFERENCE): + return "REFERENCE"; ++#if PHP_VERSION_ID < 70300 + case(IS_CONSTANT): + return "CONSTANT"; ++#endif + case(IS_CONSTANT_AST): + return "CONSTANT_AST"; + case(IS_CALLABLE):
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810141628.w9EGSSme006726>