private: add macros ROUND_UP and DIV_ROUND_UP
This commit is contained in:
parent
82d9ead6f2
commit
836baf5d63
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue