diff options
author | Brian Paul <[email protected]> | 2011-11-12 11:50:32 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-11-15 07:49:26 -0700 |
commit | b098e1af1cdaea8767b8f1416469cdd02a9c39a9 (patch) | |
tree | 63b47320224b0c75e1f00a77277810fb1bc31b6c /src/mesa/main/macros.h | |
parent | bef4b42938c92fbd6540e81ea4829b0f1d0a6a8b (diff) |
mesa: move CEILING() macro into macros.h
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r-- | src/mesa/main/macros.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index d90905f997e..029f609fd93 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -662,6 +662,10 @@ do { \ #define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]) +/** Compute ceiling of integer quotient of A divided by B. */ +#define CEILING( 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)) |