From: Nathael Pajani Date: Fri, 28 Oct 2016 01:21:10 +0000 (+0200) Subject: Add MIN and MAX (defines) to lib/utils.h X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=fdd00c5dd95f2b24ae8b69f0e5644270c8c3d176;p=soft%2Flpc122x%2Fcore Add MIN and MAX (defines) to lib/utils.h --- 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 */