# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #30879]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30879 >


Some compilers of IRIX seem to have a quite broken definition of
offsetof.  Hand-roll our own if such a compiler is detected.

-- 
Jarkko Hietaniemi <[EMAIL PROTECTED]> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

diff -u -r1.98 parrot.h
--- include/parrot/parrot.h     13 Jul 2004 14:09:17 -0000      1.98
+++ include/parrot/parrot.h     29 Jul 2004 22:49:06 -0000
@@ -179,6 +179,13 @@
 #endif /* __GCC__ */
 
 
+/* some SGI compilers have an offsetof()
+ * definition that doesn't work for us. */
+#if defined(__sgi) && defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 400)
+#undef offsetof
+#define offsetof(s, m) (size_t)(&(((s *)0)->m))
+#endif
+
 /* work around warning:
  * cast discards qualifiers from pointer target type
  * for usage grep e.g. in string.c

Reply via email to