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>
#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))
/*
#ifndef MACROS_H
#define MACROS_H
+#include "util/macros.h"
#include "util/u_math.h"
#include "imports.h"
}
-/** 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))
#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 */