From owner-svn-ports-head@freebsd.org Sat Oct 13 17:50:37 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C411810D0F62; Sat, 13 Oct 2018 17:50:37 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78B4183B1C; Sat, 13 Oct 2018 17:50:37 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B4B12360; Sat, 13 Oct 2018 17:50:37 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9DHobKn010951; Sat, 13 Oct 2018 17:50:37 GMT (envelope-from dbaio@FreeBSD.org) Received: (from dbaio@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9DHobNJ010950; Sat, 13 Oct 2018 17:50:37 GMT (envelope-from dbaio@FreeBSD.org) Message-Id: <201810131750.w9DHobNJ010950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dbaio set sender to dbaio@FreeBSD.org using -f From: "Danilo G. Baio" Date: Sat, 13 Oct 2018 17:50:37 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r482000 - in head/textproc/pecl-yaml: . files X-SVN-Group: ports-head X-SVN-Commit-Author: dbaio X-SVN-Commit-Paths: in head/textproc/pecl-yaml: . files X-SVN-Commit-Revision: 482000 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 17:50:38 -0000 Author: dbaio Date: Sat Oct 13 17:50:36 2018 New Revision: 482000 URL: https://svnweb.freebsd.org/changeset/ports/482000 Log: textproc/pecl-yaml: Fix build with PHP 7.3 Obtained from: upstream Added: head/textproc/pecl-yaml/files/ head/textproc/pecl-yaml/files/patch-emit.c (contents, props changed) Modified: head/textproc/pecl-yaml/Makefile Modified: head/textproc/pecl-yaml/Makefile ============================================================================== --- head/textproc/pecl-yaml/Makefile Sat Oct 13 17:48:38 2018 (r481999) +++ head/textproc/pecl-yaml/Makefile Sat Oct 13 17:50:36 2018 (r482000) @@ -14,6 +14,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libyaml.so:textproc/libyaml USES= php:pecl -IGNORE_WITH_PHP= 56 73 +IGNORE_WITH_PHP= 56 .include Added: head/textproc/pecl-yaml/files/patch-emit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-yaml/files/patch-emit.c Sat Oct 13 17:50:36 2018 (r482000) @@ -0,0 +1,123 @@ +https://github.com/php/pecl-file_formats-yaml/commit/a217a24a674adafd03a03382e0950cbb743ba9a8 +From a217a24a674adafd03a03382e0950cbb743ba9a8 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 4 Jul 2018 12:14:48 +0200 +Subject: [PATCH] Fix for PHP 7.3 + +--- emit.c.orig 2017-07-29 21:56:18 UTC ++++ emit.c +@@ -173,7 +173,11 @@ static void y_scan_recursion(const y_emit_state_t *sta + return; + } + ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE) && GC_IS_RECURSIVE(ht)) { ++#else + if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 0) { ++#endif + zval tmp; + ZVAL_LONG(&tmp, (zend_ulong) ht); + +@@ -182,17 +186,29 @@ static void y_scan_recursion(const y_emit_state_t *sta + return; + } + ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { ++ GC_PROTECT_RECURSION(ht); ++ } ++#else + if (ZEND_HASH_APPLY_PROTECTION(ht)) { + ht->u.v.nApplyCount++; + } ++#endif + + ZEND_HASH_FOREACH_VAL(ht, elm) { + y_scan_recursion(state, elm TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { ++ GC_UNPROTECT_RECURSION(ht); ++ } ++#else + if (ZEND_HASH_APPLY_PROTECTION(ht)) { + ht->u.v.nApplyCount--; + } ++#endif + + return; + } +@@ -462,7 +478,6 @@ static int y_write_array( + zval key_zval; + zend_ulong kidx; + zend_string *kstr; +- HashTable *tmp_ht; + zend_long recursive_idx = -1; + char *anchor = { 0 }; + size_t anchor_size; +@@ -495,7 +510,11 @@ static int y_write_array( + anchor = (char*) emalloc(anchor_size + 1); + snprintf(anchor, anchor_size + 1, "refid%ld", recursive_idx + 1); + +- if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 1) { ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE) && GC_IS_RECURSIVE(ht)) { ++#else ++ if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 0) { ++#endif + /* node has been visited before */ + status = yaml_alias_event_initialize( + &event, (yaml_char_t *) anchor); +@@ -536,6 +555,18 @@ static int y_write_array( + return FAILURE; + } + ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { ++ /* increment access count for hash */ ++ GC_PROTECT_RECURSION(ht); ++ } ++#else ++ if (ZEND_HASH_APPLY_PROTECTION(ht)) { ++ /* increment access count for hash */ ++ ht->u.v.nApplyCount++; ++ } ++#endif ++ + /* emit array elements */ + ZEND_HASH_FOREACH_KEY_VAL(ht, kidx, kstr, elm) { + ZVAL_DEREF(elm); +@@ -555,23 +586,23 @@ static int y_write_array( + } + } + +- tmp_ht = HASH_OF(elm); +- if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { +- /* increment access count for hash */ +- tmp_ht->u.v.nApplyCount++; +- } +- + status = y_write_zval(state, elm, NULL TSRMLS_CC); + +- if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { +- tmp_ht->u.v.nApplyCount--; +- } + + if (SUCCESS != status) { + return FAILURE; + } + } ZEND_HASH_FOREACH_END(); + ++#if PHP_VERSION_ID >= 70300 ++ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { ++ GC_UNPROTECT_RECURSION(ht); ++ } ++#else ++ if (ZEND_HASH_APPLY_PROTECTION(ht)) { ++ ht->u.v.nApplyCount--; ++ } ++#endif + + if (Y_ARRAY_SEQUENCE == array_type) { + status = yaml_sequence_end_event_initialize(&event);