mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-12-02 13:38:50 +00:00
Fix build with PHP master by replacing XtOffsetOf with offsetof
This commit is contained in:
parent
9ccd9aadfa
commit
2bec821239
2 changed files with 4 additions and 4 deletions
4
gnupg.c
4
gnupg.c
|
|
@ -33,7 +33,7 @@ static zend_object_handlers gnupg_object_handlers;
|
||||||
|
|
||||||
/* Helper to get object from zend_object */
|
/* Helper to get object from zend_object */
|
||||||
static inline gnupg_object *gnupg_object_from_zobj(zend_object *obj) {
|
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))
|
#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);
|
gnupg_class_entry = zend_register_internal_class(&ce);
|
||||||
|
|
||||||
memcpy(&gnupg_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
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;
|
gnupg_object_handlers.free_obj = gnupg_object_free;
|
||||||
|
|
||||||
if (SUCCESS != gnupg_keylistiterator_init(type, module_number)) {
|
if (SUCCESS != gnupg_keylistiterator_init(type, module_number)) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ static zend_object_handlers gnupg_keylistiterator_handlers;
|
||||||
/* Helper macro to get object from zend_object */
|
/* Helper macro to get object from zend_object */
|
||||||
static inline gnupg_keylistiterator_object *gnupg_keylistiterator_from_obj(zend_object *obj)
|
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))
|
#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);
|
gnupg_keylistiterator_class_entry = zend_register_internal_class(&ce);
|
||||||
|
|
||||||
memcpy(&gnupg_keylistiterator_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
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;
|
gnupg_keylistiterator_handlers.free_obj = gnupg_keylistiterator_object_free;
|
||||||
|
|
||||||
zend_class_implements(gnupg_keylistiterator_class_entry, 1, zend_ce_iterator);
|
zend_class_implements(gnupg_keylistiterator_class_entry, 1, zend_ce_iterator);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue