diff options
author | sunpoet <sunpoet@FreeBSD.org> | 2018-10-15 00:28:10 +0800 |
---|---|---|
committer | sunpoet <sunpoet@FreeBSD.org> | 2018-10-15 00:28:10 +0800 |
commit | cb97daed1b2679ad0772f03132857b7743c19c8e (patch) | |
tree | 7bd34ee2682044bc2b37f8180b033b1e4cb16468 /databases | |
parent | 0c030e0657b86535e1af2b11461d1ab85ff14ad1 (diff) | |
download | freebsd-ports-gnome-cb97daed1b2679ad0772f03132857b7743c19c8e.tar.gz freebsd-ports-gnome-cb97daed1b2679ad0772f03132857b7743c19c8e.tar.zst freebsd-ports-gnome-cb97daed1b2679ad0772f03132857b7743c19c8e.zip |
Fix build with PHP 7.3
Obtained from: https://github.com/php-memcached-dev/php-memcached/commit/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379
Diffstat (limited to 'databases')
4 files changed, 56 insertions, 2 deletions
diff --git a/databases/pecl-memcached/Makefile b/databases/pecl-memcached/Makefile index 2d0a11efc23c..75b514f7844f 100644 --- a/databases/pecl-memcached/Makefile +++ b/databases/pecl-memcached/Makefile @@ -18,10 +18,11 @@ OPTIONS_DEFINE= IGBINARY SASL OPTIONS_DEFAULT=SASL IGBINARY_DESC= Binary serializer support +USES= php:pecl pkgconfig +USE_PHP= json:build session:build + CONFIGURE_ARGS= --with-libmemcached-dir=${LOCALBASE} IGNORE_WITH_PHP=56 -USE_PHP= json:build session:build -USES= php:pecl pkgconfig IGBINARY_CONFIGURE_ENABLE= memcached-igbinary IGBINARY_USE= PHP=igbinary:build diff --git a/databases/pecl-memcached/files/patch-php_memcached.c b/databases/pecl-memcached/files/patch-php_memcached.c new file mode 100644 index 000000000000..ade1a098cd3f --- /dev/null +++ b/databases/pecl-memcached/files/patch-php_memcached.c @@ -0,0 +1,22 @@ +Obtained from: https://github.com/php-memcached-dev/php-memcached/commit/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379 + +--- php_memcached.c.orig 2017-11-21 05:01:28 UTC ++++ php_memcached.c +@@ -1281,7 +1281,7 @@ static PHP_METHOD(Memcached, __construct + le.type = php_memc_list_entry(); + le.ptr = intern->memc; + +- GC_REFCOUNT(&le) = 1; ++ GC_SET_REFCOUNT(&le, 1); + + /* plist_key is not a persistent allocated key, thus we use str_update here */ + if (zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(plist_key), ZSTR_LEN(plist_key), &le, sizeof(le)) == NULL) { +@@ -3654,7 +3654,7 @@ PHP_METHOD(MemcachedServer, on) + + Z_TRY_ADDREF(fci.function_name); + if (fci.object) { +- GC_REFCOUNT(fci.object)++; ++ GC_ADDREF(fci.object); + } + } + RETURN_BOOL(rc); diff --git a/databases/pecl-memcached/files/patch-php_memcached_private.h b/databases/pecl-memcached/files/patch-php_memcached_private.h new file mode 100644 index 000000000000..9b714a1c8a91 --- /dev/null +++ b/databases/pecl-memcached/files/patch-php_memcached_private.h @@ -0,0 +1,18 @@ +Obtained from: https://github.com/php-memcached-dev/php-memcached/commit/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379 + +--- php_memcached_private.h.orig 2017-11-21 05:01:28 UTC ++++ php_memcached_private.h +@@ -72,6 +72,13 @@ typedef unsigned long int uint32_t; + # endif + #endif + ++/* Backwards compatibility for GC API change in PHP 7.3 */ ++#if PHP_VERSION_ID < 70300 ++# define GC_ADDREF(p) ++GC_REFCOUNT(p) ++# define GC_DELREF(p) --GC_REFCOUNT(p) ++# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc ++#endif ++ + /**************************************** + Structures and definitions + ****************************************/ diff --git a/databases/pecl-memcached/files/patch-php_memcached_session.c b/databases/pecl-memcached/files/patch-php_memcached_session.c new file mode 100644 index 000000000000..994a74a6ede3 --- /dev/null +++ b/databases/pecl-memcached/files/patch-php_memcached_session.c @@ -0,0 +1,13 @@ +Obtained from: https://github.com/php-memcached-dev/php-memcached/commit/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379 + +--- php_memcached_session.c.orig 2017-11-21 05:01:28 UTC ++++ php_memcached_session.c +@@ -376,7 +376,7 @@ PS_OPEN_FUNC(memcached) + le.type = s_memc_sess_list_entry(); + le.ptr = memc; + +- GC_REFCOUNT(&le) = 1; ++ GC_SET_REFCOUNT(&le, 1); + + /* plist_key is not a persistent allocated key, thus we use str_update here */ + if (zend_hash_str_update_mem(&EG(persistent_list), plist_key, plist_key_len, &le, sizeof(le)) == NULL) { |