aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2018-10-30 06:12:24 +0800
committersunpoet <sunpoet@FreeBSD.org>2018-10-30 06:12:24 +0800
commita215f03d8e97175fe69fa0dc62431c3f83229899 (patch)
tree546ce6f11febf1c8597e89759c8ff765406351a5 /databases
parent4f75dc4ea8f83984ad2bd231482f9ddc8bffbe8a (diff)
downloadfreebsd-ports-gnome-a215f03d8e97175fe69fa0dc62431c3f83229899.tar.gz
freebsd-ports-gnome-a215f03d8e97175fe69fa0dc62431c3f83229899.tar.zst
freebsd-ports-gnome-a215f03d8e97175fe69fa0dc62431c3f83229899.zip
Fix build with PHP 7.3
Diffstat (limited to 'databases')
-rw-r--r--databases/php-xapian/files/patch-php7-php.i30
-rw-r--r--databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc30
2 files changed, 60 insertions, 0 deletions
diff --git a/databases/php-xapian/files/patch-php7-php.i b/databases/php-xapian/files/patch-php7-php.i
new file mode 100644
index 000000000000..3f7922835c17
--- /dev/null
+++ b/databases/php-xapian/files/patch-php7-php.i
@@ -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];
diff --git a/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc b/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc
new file mode 100644
index 000000000000..c4d981e6a2a0
--- /dev/null
+++ b/databases/php-xapian/files/patch-php7-php7-xapian_wrap.cc
@@ -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