mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- Change to offsetof as suggested by Clayton
This commit is contained in:
parent
ebdcf22445
commit
f81239a2b3
1 changed files with 1 additions and 4 deletions
|
@ -77,10 +77,7 @@ typedef struct {
|
|||
|
||||
static inline text_iter_obj* text_iter_to_obj(zend_object_iterator *iter)
|
||||
{
|
||||
static text_iter_obj adr;
|
||||
static int ofs = (char*)&adr.iter - (char*)&adr;
|
||||
|
||||
return (text_iter_obj *)((char*)iter - ofs);
|
||||
return (text_iter_obj *)((char*)iter - offsetof(text_iter_obj, iter));
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue