X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStg.h;h=06a866256e0d94408d2f72a6f5443a6964889af2;hb=c9acb4de50dd2b7f7ece5491f60598f0a4815e75;hp=6cbfeb45e511ee412d3147dcf21cc673157a84bf;hpb=f3052008e4fcd72681b12dfef551d0499eddf6a7;p=ghc-hetmet.git diff --git a/includes/Stg.h b/includes/Stg.h index 6cbfeb4..06a8662 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -36,7 +36,8 @@ // constants from math.h, which we occasionally need to use in .hc (#1861) # define _ISOC99_SOURCE -// Turning on _ISOC99_SOURCE means S_ISSOCK gets defined on Linux +// We need _BSD_SOURCE so that math.h defines things like gamma +// on Linux # define _BSD_SOURCE #endif @@ -77,6 +78,10 @@ #define BITS_PER_BYTE 8 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x)) +/* Compute offsets of struct fields + */ +#define STG_FIELD_OFFSET(s_type, field) ((StgWord)&(((s_type*)0)->field)) + /* * 'Portable' inlining: * INLINE_HEADER is for inline functions in header files (macros) @@ -95,7 +100,11 @@ // __attribute__((gnu_inline)). So when we don't have this, we use // ordinary static inline. // -#if defined(__GNUC_GNU_INLINE__) +// Apple's gcc defines __GNUC_GNU_INLINE__ without providing +// gnu_inline, so we exclude MacOS X and fall through to the safe +// version. +// +#if defined(__GNUC_GNU_INLINE__) && !defined(__APPLE__) # if defined(KEEP_INLINES) # define EXTERN_INLINE inline # else @@ -201,9 +210,7 @@ typedef StgWord StgWordArray[]; #include "MachRegs.h" #include "Regs.h" -#ifdef TICKY_TICKY #include "TickyCounters.h" -#endif #if IN_STG_CODE /*