From 64035225d810b843dff62c1c665fd2dfdbe82292 Mon Sep 17 00:00:00 2001 From: jakcron Date: Fri, 7 Jul 2017 09:57:21 +1000 Subject: [PATCH] [fnd] Added MIN(x,y), MAX(x,y) macros. --- lib/fnd/types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fnd/types.h b/lib/fnd/types.h index 60562d1..3f87609 100644 --- a/lib/fnd/types.h +++ b/lib/fnd/types.h @@ -17,6 +17,9 @@ typedef uint8_t u8; #define BIT(n) (1ULL << (n)) +#define MIN(x,y) ((x) <= (y)? (x) : (y)) +#define MAX(x,y) ((x) >= (y)? (x) : (y)) + static inline uint16_t __local_bswap16(uint16_t x) { return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff); }