summaryrefslogtreecommitdiff
path: root/shared/nm-utils/nm-macros-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/nm-utils/nm-macros-internal.h')
-rw-r--r--shared/nm-utils/nm-macros-internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index d1391073eb..3d2520d131 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -1137,6 +1137,14 @@ nm_clear_g_cancellable (GCancellable **cancellable)
&& ((__x & (__x - (((typeof(__x)) 1)))) == ((typeof(__x)) 0))); \
})
+#define NM_DIV_ROUND_UP(x, y) \
+ ({ \
+ const typeof(x) _x = (x); \
+ const typeof(y) _y = (y); \
+ \
+ (_x / _y + !!(_x % _y)); \
+ })
+
/*****************************************************************************/
#define NM_UTILS_LOOKUP_DEFAULT(v) return (v)