diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index 3a3a87378a..4a31c277e3 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -160,6 +160,11 @@ unsigned round_to_next_multiple_of(unsigned number, unsigned divisor); uint32_t round_uint32_to_next_multiple_of(uint32_t number, uint32_t divisor); uint64_t round_uint64_to_next_multiple_of(uint64_t number, uint64_t divisor); +/* Compute the CEIL of <b>a</b> divided by <b>b</b>, for nonnegative <b>a</b> + * and positive <b>b</b>. Works on integer types only. Not defined if a+b can + * overflow. */ +#define CEIL_DIV(a,b) (((a)+(b)-1)/(b)) + /* String manipulation */ /** Allowable characters in a hexadecimal string. */ |