Skip to content

Commit 917e28d

Browse files
committed
Assume offsetof() exists
This is a standard C macro. Define XtOffsetOf as an alias for compatibility, as this is the name we use in most code right now.
1 parent 6838ebb commit 917e28d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

Zend/zend_portability.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -329,28 +329,7 @@ char *alloca();
329329
#endif
330330

331331
#ifndef XtOffsetOf
332-
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
333-
# ifdef __STDC__
334-
# define XtOffset(p_type, field) _Offsetof(p_type, field)
335-
# else
336-
# ifdef CRAY2
337-
# define XtOffset(p_type, field) \
338-
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
339-
# else /* !CRAY2 */
340-
# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
341-
# endif /* !CRAY2 */
342-
# endif /* __STDC__ */
343-
# else /* ! (CRAY || __arm) */
344-
# define XtOffset(p_type, field) \
345-
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
346-
# endif /* !CRAY */
347-
348-
# ifdef offsetof
349332
# define XtOffsetOf(s_type, field) offsetof(s_type, field)
350-
# else
351-
# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
352-
# endif
353-
354333
#endif
355334

356335
#if (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)

0 commit comments

Comments
 (0)