summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-04-27 12:53:58 +0200
committerMarek Olšák <[email protected]>2011-04-27 13:16:35 +0200
commit069a9766a9bf62c3c6caacd0ce5fb30ece8a0eef (patch)
tree7bcc6e8aa9865ab09c2e4e01818bf66de3e7f846 /src
parent7e5953fca219ae472f3a933fc93c9e6bb61f7a49 (diff)
mesa: add macros MIN3 and MAX3
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/macros.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 86a58cc6b43..01e4d20afbf 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -669,6 +669,10 @@ do { \
/** Maximum of two values: */
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
+/** Minimum and maximum of three values: */
+#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
/** Dot product of two 2-element vectors */
#define DOT2( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )