Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 22:12:25 +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: r483406 - head/databases/php-xapian/files
Message-ID:  <201810292212.w9TMCPu9076171@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sunpoet
Date: Mon Oct 29 22:12:24 2018
New Revision: 483406
URL: https://svnweb.freebsd.org/changeset/ports/483406

Log:
  Fix build with PHP 7.3

Added:
  head/databases/php-xapian/files/
  head/databases/php-xapian/files/patch-php7-php.i   (contents, props changed)
  head/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc   (contents, props changed)

Added: head/databases/php-xapian/files/patch-php7-php.i
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/php-xapian/files/patch-php7-php.i	Mon Oct 29 22:12:24 2018	(r483406)
@@ -0,0 +1,30 @@
+--- php7/php.i.orig	2018-10-26 05:08:02 UTC
++++ php7/php.i
+@@ -177,9 +177,13 @@ fail: // Label which SWIG_PHP_Error need
+ %typemap(out) std::pair<Xapian::TermIterator, Xapian::TermIterator> {
+ 
+     ZVAL_NEW_ARR($result);
++#if PHP_VERSION_ID >= 70300
++    array_init($result);
++#else
+     if (array_init($result) == FAILURE) {
+ 	SWIG_PHP_Error(E_ERROR, "array_init failed");
+     }
++#endif
+ 
+     for (Xapian::TermIterator i = $1.first; i != $1.second; ++i) {
+ 	/* We have to cast away const here because the PHP API is rather
+@@ -198,9 +202,13 @@ fail: // Label which SWIG_PHP_Error need
+ 
+ %typemap(directorin) (size_t num_tags, const std::string tags[]) {
+     ZVAL_NEW_ARR($input);
++#if PHP_VERSION_ID >= 70300
++    array_init($input);
++#else
+     if (array_init($input) == FAILURE) {
+ 	SWIG_PHP_Error(E_ERROR, "array_init failed");
+     }
++#endif
+ 
+     for (size_t i = 0; i != num_tags; ++i) {
+ 	const string & term = tags[i];

Added: head/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc	Mon Oct 29 22:12:24 2018	(r483406)
@@ -0,0 +1,30 @@
+--- php7/php7/xapian_wrap.cc.orig	2018-10-26 05:12:41 UTC
++++ php7/php7/xapian_wrap.cc
+@@ -2533,9 +2533,13 @@ std::string SwigDirector_Compactor::reso
+   
+   {
+     ZVAL_NEW_ARR(&args[1]);
++#if PHP_VERSION_ID >= 70300
++    array_init(&args[1]);
++#else
+     if (array_init(&args[1]) == FAILURE) {
+       SWIG_PHP_Error(E_ERROR, "array_init failed");
+     }
++#endif
+     
+     for (size_t i = 0; i != num_tags; ++i) {
+       const string & term = tags[i];
+@@ -16756,9 +16760,13 @@ ZEND_NAMED_FUNCTION(_wrap_Enquire_get_ma
+   }
+   {
+     ZVAL_NEW_ARR(return_value);
++#if PHP_VERSION_ID >= 70300
++    array_init(return_value);
++#else
+     if (array_init(return_value) == FAILURE) {
+       SWIG_PHP_Error(E_ERROR, "array_init failed");
+     }
++#endif
+     
+     for (Xapian::TermIterator i = (&result)->first; i != (&result)->second; ++i) {
+       /* We have to cast away const here because the PHP API is rather



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810292212.w9TMCPu9076171>