Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cmath and math.h Changes in Xcode 2.4



From: Eric Albert
I'm curious...is there some reason why you can't simply call isnan()
and remove that block altogether?

-Eric

I might be able to kind-of answer that.

The problem with using isnan directly is that if somebody else
includes <cmath> before this, the <cmath> header undef's isnan so you
must use std::isnan.

The problem with using std::isnan everywhere (I'm told) is not all
platforms/compilers that need to be supported support this. (It
probably doesn't help that isnan is C99 so C++98 can ignore it.) So
OpenSceneGraph tries to wrap this function to provide a consistent
interface. But it must handle all the corner cases. It Apple's case,
originally I think the problem was that 10.2 or pre-10.2 did not
provide isnan or std::isnan so it went to using the __isnan versions.
More recently, the problem has been defined as using gcc 4 or
pre-gcc4, but I'm rather confused by all this as I no longer test on
anything pre-10.4. But certainly on gcc 4/Tiger, std::isnan seems to
be the right thing to do.

-Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.