X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FRts.h;h=1d455f0d6d222179ecfa7385afca22b601fb71be;hb=66579ff945831c5fc9a17c58c722ff01f2268d76;hp=5aff979fd914cdab966a49d44ada802f194f88f0;hpb=e9fdcd7b7d8ae466d83ce9f77f34e9b62b2a4fa7;p=ghc-hetmet.git diff --git a/includes/Rts.h b/includes/Rts.h index 5aff979..1d455f0 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -38,6 +38,12 @@ extern "C" { #define FLEXIBLE_ARRAY 0 #endif +#if __GNUC__ >= 3 +#define ATTRIBUTE_ALIGNED(n) __attribute__((aligned(n))) +#else +#define ATTRIBUTE_ALIGNED(n) /*nothing*/ +#endif + /* Fix for mingw stat problem (done here so it's early enough) */ #ifdef mingw32_HOST_OS #define __MSVCRT__ 1 @@ -51,7 +57,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