aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.h b/util.h
index ae70938..f60dc73 100644
--- a/util.h
+++ b/util.h
@@ -10,7 +10,8 @@ struct array {
extern char *argv0;
#define LEN(a) (sizeof(a) / sizeof((a)[0]))
-#define ALIGNUP(x, n) (((x) + (n) - 1) & ~((n) - 1))
+#define ALIGNDOWN(x, n) ((x) & -(n))
+#define ALIGNUP(x, n) ALIGNDOWN((x) + (n) - 1, n)
void warn(const char *, ...);
_Noreturn void fatal(const char *fmt, ...);