summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorsimonmar@microsoft.com <unknown>2008-02-15 13:30:40 +0000
committersimonmar@microsoft.com <unknown>2008-02-15 13:30:40 +0000
commit60680c9d7ee0a3c985f1b2c5f0d97568f2de625b (patch)
treef00a3efed2fc43aa66645a1d404add1bdd3c2b67 /includes
parent7ddc8c386be03309f6bc395101b84ebdf637025e (diff)
downloadhaskell-60680c9d7ee0a3c985f1b2c5f0d97568f2de625b.tar.gz
add ROUNDUP_BYTES_TO_WDS
Diffstat (limited to 'includes')
-rw-r--r--includes/Rts.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index 5aff979fd9..ec84ed9671 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -51,7 +51,9 @@ extern "C" {
* We often want to know the size of something in units of an
* StgWord... (rounded up, of course!)
*/
-#define sizeofW(t) ((sizeof(t)+sizeof(W_)-1)/sizeof(W_))
+#define ROUNDUP_BYTES_TO_WDS(n) (((n) + sizeof(W_) - 1) / sizeof(W_))
+
+#define sizeofW(t) ROUNDUP_BYTES_TO_WDS(sizeof(t))
/*
* It's nice to be able to grep for casts