aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/sysdefs.h12
1 files changed, 5 insertions, 7 deletions
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]))