summaryrefslogtreecommitdiff
path: root/includes/Stg.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-12-02 12:07:35 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-12-02 12:07:35 +0000
commit164be7854f6de07bb4bc15f60af727ddb562cde7 (patch)
tree1a731627a6d78e425098f27082aa428fead2cd25 /includes/Stg.h
parentc0378a2774a400e2992bc57a7ec580df3f142b29 (diff)
downloadhaskell-164be7854f6de07bb4bc15f60af727ddb562cde7.tar.gz
Fix more problems caused by padding in the Capability structure
Fixes crashes on Windows and Sparc
Diffstat (limited to 'includes/Stg.h')
-rw-r--r--includes/Stg.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/Stg.h b/includes/Stg.h
index 7ac6b1a864..394c987f07 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)