diff mbox

[libdrm,06/12] util_math: add MAX3 macro

Message ID 1441819293-25567-7-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov Sept. 9, 2015, 5:21 p.m. UTC
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 util_math.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/util_math.h b/util_math.h
index 3bc5f64..02b15a8 100644
--- a/util_math.h
+++ b/util_math.h
@@ -26,6 +26,7 @@ 
 
 #define MIN2( A, B )   ( (A)<(B) ? (A) : (B) )
 #define MAX2( A, B )   ( (A)>(B) ? (A) : (B) )
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
 
 #define __align_mask(value, mask)  (((value) + (mask)) & ~(mask))
 #define ALIGN(value, alignment)    __align_mask(value, (typeof(value))((alignment) - 1))