Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2002 23:49:47 -0500 (CDT)
From:      "Chris S.J. Peron" <maneo@bsdpro.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   gnu/42154: [patch] gnu: libobjc redefines MIN and MAX macros
Message-ID:  <200208290449.g7T4nldi096734@xor.sqrt.ca>

next in thread | raw e-mail | index | archive | help

>Number:         42154
>Category:       gnu
>Synopsis:       [patch] gnu: libobjc redefines MIN and MAX macros
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 21:50:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Chris S.J. Peron
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD xor.sqrt.ca 4.6-STABLE FreeBSD 4.6-STABLE #3: Tue Aug 13 17:17:48 CDT 2002 cperon@xor.sqrt.ca:/usr/src/sys/compile/opcode i386


	
>Description:

libobjc redefines the MIN and MAX macros previously defined in
sys/param.h. During a buildworld warnings are issued:

/usr/src/gnu/lib/libobjc/../../../contrib/libobjc/encoding.c:35: \
	warning: `MAX' redefined
/usr/obj/usr/src/i386/usr/include/sys/param.h:214: \
	warning: this is the location of the previous definition
/usr/src/gnu/lib/libobjc/../../../contrib/libobjc/encoding.c:39: \
	warning: `MIN' redefined
/usr/obj/usr/src/i386/usr/include/sys/param.h:213: \
	warning: this is the location of the previous definition
	
	
>How-To-Repeat:
	compile libobjc
	
>Fix:

--- /usr/src/contrib/libobjc/encoding.c.bak	Wed Aug 28 23:36:04 2002
+++ /usr/src/contrib/libobjc/encoding.c	Wed Aug 28 23:36:40 2002
@@ -30,13 +30,16 @@
 #include "objc-api.h"
 #include "encoding.h"
 
+#if (!defined(MAX))
 #define MAX(X, Y)                    \
   ({ typeof(X) __x = (X), __y = (Y); \
      (__x > __y ? __x : __y); })
-
+#endif
+#if (!defined(MIN))
 #define MIN(X, Y)                    \
   ({ typeof(X) __x = (X), __y = (Y); \
      (__x < __y ? __x : __y); })
+#endif
 
 #define ROUND(V, A) \
   ({ typeof(V) __v=(V); typeof(A) __a=(A); \

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208290449.g7T4nldi096734>