X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStg.h;h=394c987f079e3732cbaa905c70f404618d92f9bb;hb=8305bb1641490429912a8ac5c3b1265a21937689;hp=7ac6b1a86427e25853412c3dda8749c1569a66aa;hpb=5ee6212c3b25c14db37bc01beeca67707736c406;p=ghc-hetmet.git diff --git a/includes/Stg.h b/includes/Stg.h index 7ac6b1a..394c987 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -74,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)