Skip to content

Commit 15b1e4b

Browse files
author
Sterling Hughes
committed
Fix XtOffsetOf compile problems if someone has already defined it.
1 parent 244c9ff commit 15b1e4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main/php.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ PHPAPI int cfg_get_string(char *varname, char **result);
315315
* Taken from the Apache code, which in turn, was taken from X code...
316316
*/
317317

318+
#ifndef XtOffset
318319
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
319320
#ifdef __STDC__
320321
#define XtOffset(p_type, field) _Offsetof(p_type, field)
@@ -335,13 +336,16 @@ PHPAPI int cfg_get_string(char *varname, char **result);
335336
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
336337

337338
#endif /* !CRAY */
339+
#endif /* ! XtOffset */
338340

341+
#ifndef XtOffsetOf
339342
#ifdef offsetof
340343
#define XtOffsetOf(s_type, field) offsetof(s_type, field)
341344
#else
342345
#define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
343346
#endif
344-
347+
#endif /* !XtOffsetOf */
348+
345349
PHPAPI PHP_FUNCTION(warn_not_available);
346350

347351
#endif

0 commit comments

Comments
 (0)