From fdd00c5dd95f2b24ae8b69f0e5644270c8c3d176 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Fri, 28 Oct 2016 03:21:10 +0200 Subject: [PATCH] Add MIN and MAX (defines) to lib/utils.h --- include/lib/utils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/lib/utils.h b/include/lib/utils.h index 5062d1c..7620c4e 100644 --- a/include/lib/utils.h +++ b/include/lib/utils.h @@ -63,5 +63,12 @@ static inline uint32_t htonl(uint32_t val) __attribute__ ((alias ("byte_swap_32" /* Short versions */ static inline uint32_t ntohs(uint32_t val) __attribute__ ((alias ("byte_swap_16"))); static inline uint32_t htons(uint32_t val) __attribute__ ((alias ("byte_swap_16"))); + + +/* MIN and MAX */ +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + + #endif /* LIB_UTILS_H */ -- 2.43.0