util/macros: Move DIV_ROUND_UP to util/macros.h

Move DIV_ROUND_UP to a shared location accessible everywhere

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
Axel Davy 2015-04-26 23:17:45 +02:00
parent 405c7d7511
commit 64880d073a
3 changed files with 3 additions and 6 deletions

View file

@ -35,8 +35,6 @@
#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
#endif
#define DIV_ROUND_UP(x, y) (((x) + (y) - 1) / (y))
#define max_t(type, x, y) ((x) > (y) ? (x) : (y))
/*

View file

@ -31,6 +31,7 @@
#ifndef MACROS_H
#define MACROS_H
#include "util/macros.h"
#include "util/u_math.h"
#include "imports.h"
@ -800,10 +801,6 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y)
}
/** Compute ceiling of integer quotient of A divided by B. */
#define DIV_ROUND_UP( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
/** casts to silence warnings with some compilers */
#define ENUM_TO_INT(E) ((GLint)(E))
#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E))

View file

@ -182,5 +182,7 @@ do { \
#define UNUSED
#endif
/** Compute ceiling of integer quotient of A divided by B. */
#define DIV_ROUND_UP( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
#endif /* UTIL_MACROS_H */