core: add ROUND_UP() macro

pull/24503/head
Ben Noordhuis 2012-03-27 15:42:51 +02:00
parent 9d1fde7519
commit a58659cd4a
1 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,10 @@ namespace node {
# define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
#endif
#ifndef ROUND_UP
# define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a))
#endif
// this would have been a template function were it not for the fact that g++
// sometimes fails to resolve it...
#define THROW_ERROR(fun) \