X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStg.h;h=394c987f079e3732cbaa905c70f404618d92f9bb;hb=3710a4ef1ca665fe4ed705a6b0f4400d680c7b54;hp=32e838090b76e93cd62d341bc13bad0accc7808c;hpb=ba1d2fd1914971cd2f9c351670805ea512b6a281;p=ghc-hetmet.git diff --git a/includes/Stg.h b/includes/Stg.h index 32e8380..394c987 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -35,9 +35,6 @@ // Turn on C99 for .hc code. This gives us the INFINITY and NAN // 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 -# define _BSD_SOURCE #endif #if IN_STG_CODE == 0 @@ -77,6 +74,10 @@ #define BITS_PER_BYTE 8 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x)) +/* Compute offsets of struct fields + */ +#define FIELD_OFFSET(s_type, field) ((StgWord)&(((s_type*)0)->field)) + /* * 'Portable' inlining: * INLINE_HEADER is for inline functions in header files (macros)