Fix build with PHP master by replacing XtOffsetOf with offsetof

This commit is contained in:
Jakub Zelenka 2026-11-22 14:04:44 +01:00
commit 2bec821239
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
2 changed files with 4 additions and 4 deletions

View file

@ -33,7 +33,7 @@ static zend_object_handlers gnupg_object_handlers;
/* Helper to get object from zend_object */
static inline gnupg_object *gnupg_object_from_zobj(zend_object *obj) {
return (gnupg_object *)((char *)(obj) - XtOffsetOf(gnupg_object, std));
return (gnupg_object *)((char *)(obj) - offsetof(gnupg_object, std));
}
#define Z_GNUPG_P(zv) gnupg_object_from_zobj(Z_OBJ_P(zv))
@ -531,7 +531,7 @@ PHP_MINIT_FUNCTION(gnupg)
gnupg_class_entry = zend_register_internal_class(&ce);
memcpy(&gnupg_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
gnupg_object_handlers.offset = XtOffsetOf(gnupg_object, std);
gnupg_object_handlers.offset = offsetof(gnupg_object, std);
gnupg_object_handlers.free_obj = gnupg_object_free;
if (SUCCESS != gnupg_keylistiterator_init(type, module_number)) {

View file

@ -35,7 +35,7 @@ static zend_object_handlers gnupg_keylistiterator_handlers;
/* Helper macro to get object from zend_object */
static inline gnupg_keylistiterator_object *gnupg_keylistiterator_from_obj(zend_object *obj)
{
return (gnupg_keylistiterator_object *)((char *)(obj) - XtOffsetOf(gnupg_keylistiterator_object, std));
return (gnupg_keylistiterator_object *)((char *)(obj) - offsetof(gnupg_keylistiterator_object, std));
}
#define Z_GNUPG_KEYLISTITERATOR_P(zv) gnupg_keylistiterator_from_obj(Z_OBJ_P(zv))
@ -134,7 +134,7 @@ int gnupg_keylistiterator_init(INIT_FUNC_ARGS)
gnupg_keylistiterator_class_entry = zend_register_internal_class(&ce);
memcpy(&gnupg_keylistiterator_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
gnupg_keylistiterator_handlers.offset = XtOffsetOf(gnupg_keylistiterator_object, std);
gnupg_keylistiterator_handlers.offset = offsetof(gnupg_keylistiterator_object, std);
gnupg_keylistiterator_handlers.free_obj = gnupg_keylistiterator_object_free;
zend_class_implements(gnupg_keylistiterator_class_entry, 1, zend_ce_iterator);