From e1e663300c540594c46f7b431018d5c60a4b826c Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sun, 12 Mar 2000 08:33:15 +0000 Subject: [PATCH] Added macro: bound(min, val, max) is shorthand for min(maxval, max(val, minval)). --- common/common_quakedef.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/common_quakedef.h b/common/common_quakedef.h index da3e600..c2e2acf 100644 --- a/common/common_quakedef.h +++ b/common/common_quakedef.h @@ -56,6 +56,10 @@ void VID_UnlockBuffer (void); #define min(a,b) ((a) < (b) ? (a) : (b)) #endif +#ifndef bound +#define bound(a,b,c) (max(a, min(b, c)) +#endif + /* This fixes warnings when compiling with -pedantic */ #if defined(__GNUC__) && !defined(inline) # define inline __inline__