diff options
Diffstat (limited to 'libs/pwyazh')
-rw-r--r-- | libs/pwyazh/macros.h | 3 | ||||
-rw-r--r-- | libs/pwyazh/strings.h | 1 |
2 files changed, 4 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> diff --git a/libs/pwyazh/strings.h b/libs/pwyazh/strings.h index ebb351a..ee8c7b2 100644 --- a/libs/pwyazh/strings.h +++ b/libs/pwyazh/strings.h @@ -2,6 +2,7 @@ #define STRINGS_H #include "types.h" +#include "macros.h" #define str8_lit(s) str8((U8 *)(s), sizeof(s)-1) |