aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-12-18 18:46:41 +0100
committerBoris Faure <billiob@gmail.com>2016-12-18 18:46:41 +0100
commit836baf5d63e74a46d2d0fb028cd8457c4467587c (patch)
treee0f1418c555d8cfb386b40986c622cdc74edf77d
parenttermptyesc: handle correctly Character Tabulation Set (HTS). Ref T4992 (diff)
downloadterminology-836baf5d63e74a46d2d0fb028cd8457c4467587c.tar.gz
private: add macros ROUND_UP and DIV_ROUND_UP
-rw-r--r--src/bin/private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bin/private.h b/src/bin/private.h
index c797499..0e7eb90 100644
--- a/src/bin/private.h
+++ b/src/bin/private.h
@@ -28,4 +28,14 @@ extern int _log_domain;
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
+#ifndef DIV_ROUND_UP
+# define DIV_ROUND_UP(_v, _n) \
+ (((_v) + (_n) - 1) / (_n))
+#endif
+
+#ifndef ROUND_UP
+# define ROUND_UP(_v, _n) \
+ (DIV_ROUND_UP((_v), (_n)) * (_n))
+#endif
+
#endif