File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,11 +68,9 @@ typedef struct php_stream_poll_handle_data {
6868} php_stream_poll_handle_data ;
6969
7070/* Accessor macros */
71- #define PHP_POLL_CONTEXT_OBJ_FROM_ZOBJ (_obj ) \
72- ((php_io_poll_context_object *) ((char *) (_obj) - offsetof(php_io_poll_context_object, std)))
71+ #define PHP_POLL_CONTEXT_OBJ_FROM_ZOBJ (_obj ) ZEND_CONTAINER_OF(_obj, php_io_poll_context_object, std)
7372
74- #define PHP_POLL_WATCHER_OBJ_FROM_ZOBJ (_obj ) \
75- ((php_io_poll_watcher_object *) ((char *) (_obj) - offsetof(php_io_poll_watcher_object, std)))
73+ #define PHP_POLL_WATCHER_OBJ_FROM_ZOBJ (_obj ) ZEND_CONTAINER_OF(_obj, php_io_poll_watcher_object, std)
7674
7775#define PHP_POLL_WATCHER_OBJ_FROM_ZV (_zv ) PHP_POLL_WATCHER_OBJ_FROM_ZOBJ(Z_OBJ_P(_zv))
7876#define PHP_POLL_CONTEXT_OBJ_FROM_ZV (_zv ) PHP_POLL_CONTEXT_OBJ_FROM_ZOBJ(Z_OBJ_P(_zv))
Original file line number Diff line number Diff line change @@ -158,8 +158,7 @@ struct php_poll_handle_object {
158158 zend_object std ;
159159};
160160
161- #define PHP_POLL_HANDLE_OBJ_FROM_ZOBJ (obj ) \
162- ((php_poll_handle_object *) ((char *) (obj) - offsetof(php_poll_handle_object, std)))
161+ #define PHP_POLL_HANDLE_OBJ_FROM_ZOBJ (obj ) ZEND_CONTAINER_OF(obj, php_poll_handle_object, std)
163162
164163#define PHP_POLL_HANDLE_OBJ_FROM_ZV (zv ) PHP_POLL_HANDLE_OBJ_FROM_ZOBJ(Z_OBJ_P(zv))
165164
You can’t perform that action at this time.
0 commit comments