From 60680c9d7ee0a3c985f1b2c5f0d97568f2de625b Mon Sep 17 00:00:00 2001 From: "simonmar@microsoft.com" Date: Fri, 15 Feb 2008 13:30:40 +0000 Subject: [PATCH] add ROUNDUP_BYTES_TO_WDS --- includes/Rts.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Rts.h b/includes/Rts.h index 5aff979..ec84ed9 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 -- 1.7.10.4