diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-05-30 22:41:36 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-05-30 22:41:36 +0200 |
commit | 1880c97df10770eba8dbf1f068903e713dbf3f7e (patch) | |
tree | 657f3bd9b0b17c618fe22fc9550a396080772634 /libguile/_scm.h | |
parent | fd449a269050b50cb639f695508bf2859a30841b (diff) | |
download | guile-1880c97df10770eba8dbf1f068903e713dbf3f7e.tar.gz |
Fix parenthesizing of the `ROUND_UP' macro; factorize.
* libguile/_scm.h (ROUND_UP): New macro.
* libguile/continuations.c (ROUND_UP): Remove.
* libguile/control.c (ROUND_UP): Remove.
* libguile/foreign.c (ROUND_UP): Remove.
Diffstat (limited to 'libguile/_scm.h')
-rw-r--r-- | libguile/_scm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/_scm.h b/libguile/_scm.h index 9cd6fadf0..bf655b3fe 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -118,6 +118,10 @@ #define max(A, B) ((A) >= (B) ? (A) : (B)) #endif +/* Return the first integer greater than or equal to LEN such that + LEN % ALIGN == 0. Return LEN if ALIGN is zero. */ +#define ROUND_UP(len, align) \ + ((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len)) #if GUILE_USE_64_CALLS && defined(HAVE_STAT64) |