diff options
Diffstat (limited to 'libs/pwyazh/macros.h')
-rw-r--r-- | libs/pwyazh/macros.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/pwyazh/macros.h b/libs/pwyazh/macros.h index 55927c1..7ec0918 100644 --- a/libs/pwyazh/macros.h +++ b/libs/pwyazh/macros.h @@ -20,6 +20,9 @@ #define ClampTop(a, b) Min(a, b) #define ClampBottom(a, b) Max(a, b) +#define clamp(min, x, max) \ + (((x) <= (min)) ? (min) : \ + ((x) >= (max)) ? (max) : (x)) #include <string.h> |