Patchwork mtd-utils: dont redefine MIN()

login
register
mail settings
Submitter Mike Frysinger
Date Oct. 1, 2010, 5:44 a.m.
Message ID <1285911861-9621-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/66308/
State Accepted, archived
Headers show

Comments

Mike Frysinger - Oct. 1, 2010, 5:44 a.m.
Some C library headers will define MIN(), so add an #ifndef check.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 include/common.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/include/common.h b/include/common.h
index 6684a73..25abc0c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -33,7 +33,9 @@ 
 extern "C" {
 #endif
 
+#ifndef MIN	/* some C lib headers define this for us */
 #define MIN(a ,b) ((a) < (b) ? (a) : (b))
+#endif
 #define min(a, b) MIN(a, b) /* glue for linux kernel source */
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))