summaryrefslogtreecommitdiff
path: root/libguile/_scm.h
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-05-30 22:41:36 +0200
committerLudovic Courtès <ludo@gnu.org>2010-05-30 22:41:36 +0200
commit1880c97df10770eba8dbf1f068903e713dbf3f7e (patch)
tree657f3bd9b0b17c618fe22fc9550a396080772634 /libguile/_scm.h
parentfd449a269050b50cb639f695508bf2859a30841b (diff)
downloadguile-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.h4
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)