From: Karel Zak Date: Tue, 16 Mar 2010 14:24:04 +0000 (+0100) Subject: lib: add #ifndef around min() max() macros X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70502c5246815c35dba4d062ef4152d71b827ef8;p=util-linux lib: add #ifndef around min() max() macros Signed-off-by: Karel Zak --- 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 */