From 920a69a8d8e4203c5edddd829d932130eac188ea Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Wed, 26 May 2010 10:36:46 +0300 Subject: Rename MIN() and MAX() to my_min() and my_max(). This should avoid some minor portability issues. --- src/common/sysdefs.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/common') diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h index 61ac0b40..1e138b1c 100644 --- a/src/common/sysdefs.h +++ b/src/common/sysdefs.h @@ -156,13 +156,11 @@ typedef unsigned char _Bool; #undef memzero #define memzero(s, n) memset(s, 0, n) -#ifndef MIN -# define MIN(x, y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -# define MAX(x, y) ((x) > (y) ? (x) : (y)) -#endif +// NOTE: Avoid using MIN() and MAX(), because even conditionally defining +// those macros can cause some portability trouble, since on some systems +// the system headers insist defining their own versions. +#define my_min(x, y) ((x) < (y) ? (x) : (y)) +#define my_max(x, y) ((x) > (y) ? (x) : (y)) #ifndef ARRAY_SIZE # define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) -- cgit v1.2.3