From owner-freebsd-current Fri Mar 21 0:55:14 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D272337B401; Fri, 21 Mar 2003 00:55:12 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8398043FA3; Fri, 21 Mar 2003 00:55:01 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h2L8sxmR010079; Fri, 21 Mar 2003 00:54:59 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h2L8sxvY010078; Fri, 21 Mar 2003 00:54:59 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Fri, 21 Mar 2003 00:54:59 -0800 From: David Schultz To: Tim Robbins Cc: Kris Kennaway , current@FreeBSD.ORG Subject: Re: Port breakage (isnan undeclared) Message-ID: <20030321085459.GA10003@HAL9000.homeunix.com> Mail-Followup-To: Tim Robbins , Kris Kennaway , current@FreeBSD.ORG References: <20030320085522.GA13634@rot13.obsecurity.org> <20030320202706.A35844@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030320202706.A35844@dilbert.robbins.dropbear.id.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Tim Robbins : > On Thu, Mar 20, 2003 at 12:55:22AM -0800, Kris Kennaway wrote: > > > Several ports have become broken recently with the following error: > > > > ../../../include/osg/Math:149: `isnan' undeclared (first use this function) > > > > http://bento.freebsd.org/errorlogs/i386-5-latest/osg-0.9.3.log > > http://bento.freebsd.org/errorlogs/i386-5-latest/gnucap-0.31.log > > http://bento.freebsd.org/errorlogs/i386-5-latest/fractorama-1.6.4.log > > > > Can someone please investigate? > > The prototypes for isnan() &c. need to be put back into math.h, and their > source files need to be un-deprecated. C99 requires that isnan() be a macro, since it can take arguments of multiple types and C doesn't support templates or overloading. Technically, redundant function and macro implementations can coexist, but that's gross. A better solution may be to define _GLIBCPP_USE_C99 to 1 in libstdc++. Among other things, this tells the C++ library to capture standard C99 macros such as isnan() in a wrapper in the std namespace before undefing them as it does now. The appropriate configure option is --enable-c99, BTW. If a real C++ guru could make sure this doesn't break anything else I would be grateful. What I don't understand is why the libstdc++ all-your-macros-are-belong-to-us magic gets pulled in when you say '#include ' instead of . That's going to break programs (such as fractorama) that expect isnan() and friends to be in the global namespace. Again, comments from someone with C++ fu would be appreciated. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message