]> granicus.if.org Git - php/commitdiff
Remove duplicate XtOffsetOf() definitions in php.h
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 12 Jul 2019 11:18:18 +0000 (13:18 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 12 Jul 2019 11:18:18 +0000 (13:18 +0200)
These are already defined in zend_portability.h.

main/php.h

index 480da6fb18d0912af78d0c229820112dc293a1e2..4bc054539c6ca0ed392f4b0f082088e0f4cb385c 100644 (file)
@@ -448,39 +448,4 @@ END_EXTERN_C()
 
 #include "php_reentrancy.h"
 
-/* Finding offsets of elements within structures.
- * Taken from the Apache code, which in turn, was taken from X code...
- */
-
-#ifndef XtOffset
-#if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__riscos__)))
-#ifdef __STDC__
-#define XtOffset(p_type, field) _Offsetof(p_type, field)
-#else
-#ifdef CRAY2
-#define XtOffset(p_type, field) \
-    (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
-
-#else /* !CRAY2 */
-
-#define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
-
-#endif /* !CRAY2 */
-#endif /* __STDC__ */
-#else /* ! (CRAY || __arm) */
-
-#define XtOffset(p_type, field) \
-    ((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
-
-#endif /* !CRAY */
-#endif /* ! XtOffset */
-
-#ifndef XtOffsetOf
-#ifdef offsetof
-#define XtOffsetOf(s_type, field) offsetof(s_type, field)
-#else
-#define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
-#endif
-#endif /* !XtOffsetOf */
-
 #endif