From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?Q?Andreas=20V=F6gele?= Newsgroups: gmane.lisp.guile.bugs Subject: MIN macro in numbers.c causes build problems on HP-UX Date: Sun, 25 Apr 2004 17:04:02 +0200 Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082905512 7798 80.91.224.253 (25 Apr 2004 15:05:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Apr 2004 15:05:12 +0000 (UTC) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Apr 25 17:05:07 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHlBr-00059Z-00 for ; Sun, 25 Apr 2004 17:05:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHlBd-0000cr-Q0 for guile-bugs@m.gmane.org; Sun, 25 Apr 2004 11:04:53 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHlBP-0000Rl-S2 for bug-guile@gnu.org; Sun, 25 Apr 2004 11:04:39 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHlAr-0007ky-Au for bug-guile@gnu.org; Sun, 25 Apr 2004 11:04:36 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.30) id 1BHlAq-0007kt-Rr for bug-guile@gnu.org; Sun, 25 Apr 2004 11:04:04 -0400 Original-Received: (qmail 3673 invoked by uid 65534); 25 Apr 2004 15:04:03 -0000 Original-Received: from pD95E98F0.dip.t-dialin.net (EHLO hermes.voegele.dyndns.org) (217.94.152.240) by mail.gmx.net (mp017) with SMTP; 25 Apr 2004 17:04:03 +0200 X-Authenticated: #14729429 Original-To: bug-guile@gnu.org X-Request-PGP: http://pgp.mit.edu:11371/pks/lookup?search=0x12C21DCA&op=index X-PGP-KeyID: 12C21DCA X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.bugs:1334 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:1334 On HP-UX, the macros MIN and MAX are defined in sys/param.h which is included by limits.h. There's an unconditional definition of MIN in the CVS version of numbers.c which clashes with HP's definition. Here's the error message: ./guile-snarf -o numbers.x numbers.c -DHAVE_CONFIG_H -I.. -I.. -I../libguile-ltdl -g -fno-strict-aliasing -Wall -Wmissing-prototypes -Werror numbers.c:1797:1: "MIN" redefined [...] /usr/include/sys/param.h:420:1: this is the location of the previous definition I suggest to remove the MIN macro from numbers.c. Instead, the lower case macro min, which is definded in _scm.h anyway, can be used. I'm wondering why the MIN macro was introduced at all. Here's a patch: Index: numbers.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/numbers.c,v retrieving revision 1.238 diff -u -r1.238 numbers.c --- numbers.c 22 Apr 2004 01:21:39 -0000 1.238 +++ numbers.c 25 Apr 2004 14:48:23 -0000 @@ -1794,8 +1794,6 @@ #undef FUNC_NAME -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - SCM_DEFINE (scm_bit_extract, "bit-extract", 3, 0, 0, (SCM n, SCM start, SCM end), "Return the integer composed of the @var{start} (inclusive)\n" @@ -1824,7 +1822,7 @@ /* When istart>=SCM_I_FIXNUM_BIT we can just limit the shift to SCM_I_FIXNUM_BIT-1 to get either 0 or -1 per the sign of "in". */ - in = SCM_SRS (in, MIN (istart, SCM_I_FIXNUM_BIT-1)); + in = SCM_SRS (in, min (istart, SCM_I_FIXNUM_BIT-1)); if (in < 0 && bits >= SCM_I_FIXNUM_BIT) { @@ -1839,7 +1837,7 @@ } /* mask down to requisite bits */ - bits = MIN (bits, SCM_I_FIXNUM_BIT); + bits = min (bits, SCM_I_FIXNUM_BIT); return SCM_MAKINUM (in & ((1L << bits) - 1)); } else if (SCM_BIGP (n)) _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://mail.gnu.org/mailman/listinfo/bug-guile