summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2018-09-02 18:15:40 +0200
committerDmitry V. Levin <ldv@altlinux.org>2018-09-02 22:03:43 +0000
commitcbbf708b4d2f8a66b07cf805f82edbe892c0bbf7 (patch)
tree2f5b06b6dc752eec4e54534d1cc27e75275c0426 /macros.h
parentc3ac40611c339ff0a80598a1f0bf5ab3d2120d99 (diff)
downloadstrace-cbbf708b4d2f8a66b07cf805f82edbe892c0bbf7.tar.gz
macros: add ROUNDUP macro
* macros.h (ROUNDUP): New macro.
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index f5334efbe..a682b7716 100644
--- a/macros.h
+++ b/macros.h
@@ -48,6 +48,10 @@
#endif
#define CLAMP(val, min, max) MIN(MAX(min, val), max)
+#ifndef ROUNDUP
+# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
+#endif
+
#ifndef offsetofend
# define offsetofend(type_, member_) \
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))