From 70502c5246815c35dba4d062ef4152d71b827ef8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Mar 2010 15:24:04 +0100 Subject: [PATCH] lib: add #ifndef around min() max() macros Signed-off-by: Karel Zak --- include/c.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/c.h b/include/c.h index 6615f6fe..577b8a80 100644 --- a/include/c.h +++ b/include/c.h @@ -46,17 +46,20 @@ # define FALSE 0 #endif - -#define min(x, y) ({ \ +#ifndef min +# define min(x, y) ({ \ typeof(x) _min1 = (x); \ typeof(y) _min2 = (y); \ (void) (&_min1 == &_min2); \ _min1 < _min2 ? _min1 : _min2; }) +#endif -#define max(x, y) ({ \ +#ifndef max +# define max(x, y) ({ \ typeof(x) _max1 = (x); \ typeof(y) _max2 = (y); \ (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) +#endif #endif /* UTIL_LINUX_C_H */ -- 2.39.5