summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-07-16 11:18:22 +0200
committerRemi Collet <remi@php.net>2026-07-16 11:18:22 +0200
commitaa97b61a4015445abc7c349e7c5f76c4d6e0440c (patch)
tree8478b7dd23ab1ddd911fb55114994899502ff32d
parent18b9dcadf4122bbfa61a6dd8ae6eb04d370a5934 (diff)
fix build with PHP 8.6.0alpha2 using patch fromHEADmaster
https://github.com/orieg/php-judy/pull/65
-rw-r--r--65.patch41
-rw-r--r--php-orieg-judy.spec11
2 files changed, 50 insertions, 2 deletions
diff --git a/65.patch b/65.patch
new file mode 100644
index 0000000..35c400e
--- /dev/null
+++ b/65.patch
@@ -0,0 +1,41 @@
+From 9e999e464615a3b36051ffaa0424bdb6f5599934 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 16 Jul 2026 11:14:47 +0200
+Subject: [PATCH] Fix build with PHP 8.6.0alpha2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+ . The XtOffsetOf() alias of C’s offsetof() macro has been removed. Use
+ offsetof() directly.
+---
+ php_judy.c | 2 +-
+ php_judy.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/php_judy.c b/php_judy.c
+index a7387e7..01886ab 100644
+--- a/php_judy.c
++++ b/php_judy.c
+@@ -1138,7 +1138,7 @@ PHP_MINIT_FUNCTION(judy)
+ judy_handlers.has_dimension = judy_object_has_dimension;
+ judy_handlers.dtor_obj = zend_objects_destroy_object;
+ judy_handlers.free_obj = judy_object_free_storage;
+- judy_handlers.offset = XtOffsetOf(judy_object, std);
++ judy_handlers.offset = offsetof(judy_object, std);
+
+ /* implements some interface to provide access to judy object as an array */
+ zend_class_implements(judy_ce, 4, zend_ce_arrayaccess, zend_ce_countable, zend_ce_iterator, php_json_serializable_ce);
+diff --git a/php_judy.h b/php_judy.h
+index 6239c23..55b53e5 100644
+--- a/php_judy.h
++++ b/php_judy.h
+@@ -215,7 +215,7 @@ typedef struct _judy_object {
+ } judy_object;
+
+ static inline judy_object *php_judy_object(zend_object *obj) {
+- return (judy_object *)((char*)(obj) - XtOffsetOf(judy_object, std));
++ return (judy_object *)((char*)(obj) - offsetof(judy_object, std));
+ }
+
+ static inline int judy_pack_short_string_internal(const char *str, size_t len, Word_t *index)
diff --git a/php-orieg-judy.spec b/php-orieg-judy.spec
index 052d5a5..e0eade4 100644
--- a/php-orieg-judy.spec
+++ b/php-orieg-judy.spec
@@ -34,13 +34,15 @@
Summary: PHP Judy implements sparse dynamic arrays
Name: %{?scl_prefix}php-%{pie_vend}-%{pie_proj}
+License: PHP-3.01
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
%forgemeta
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: PHP-3.01
URL: %{forgeurl}
Source0: %{forgesource}
+Patch0: 65.patch
+
BuildRequires: make
BuildRequires: gcc
BuildRequires: %{?scl_prefix}php-devel >= 8.0
@@ -83,6 +85,7 @@ These are the files needed to compile programs using %{name}.
%prep
%forgesetup
+%patch -P0 -p1
: Sanity check, really often broken
extver=$(sed -n '/#define PHP_JUDY_VERSION/{s/.* "//;s/".*$//;p}' php_judy.h)
@@ -143,6 +146,10 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_extdir}/%{ext_name}.so" \
%changelog
+* Thu Jul 16 2026 Remi Collet <remi@remirepo.net> - 2.4.0-2
+- fix build with PHP 8.6.0alpha2 using patch from
+ https://github.com/orieg/php-judy/pull/65
+
* Tue Mar 3 2026 Remi Collet <remi@remirepo.net> - 2.4.0-1
- update to 2.4.0