From patchwork Tue Nov 17 17:20:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 9707 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 72274 invoked by alias); 17 Nov 2015 17:20:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72256 invoked by uid 89); 17 Nov 2015 17:20:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e38.co.us.ibm.com X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: murphyp@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: "Paul E. Murphy" Subject: [PATCH] Prevent multiple definition of MIN/MAX To: "libc-alpha@sourceware.org" Cc: Joseph Myers , Tulio Magno Quites Machado Filho , Carlos Eduardo Seo Message-ID: <564B61EA.7030200@linux.vnet.ibm.com> Date: Tue, 17 Nov 2015 11:20:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15111717-0029-0000-0000-00000E317903 Some recent changes caused a redefinition and error when these are unconditionally defined. Such was caused by gmp-impl.h being included prior. 2015-11-17 Paul E. Murphy * misc/sys/param.h (MIN): Guard against an outside definition. (MAX): Likewise. --- misc/sys/param.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/sys/param.h b/misc/sys/param.h index 1908b93..42aa434 100644 --- a/misc/sys/param.h +++ b/misc/sys/param.h @@ -99,8 +99,12 @@ #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef MAX +# define MAX(a,b) (((a)>(b))?(a):(b)) +#endif #endif /* sys/param.h */