Thus spake Tim Robbins <[EMAIL PROTECTED]>: > 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 <math.h>' instead of <cmath>. 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 [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message