[Bf-committers] [12864] trunk/blender/intern/elbeem/intern : finite isnt defined on solaris 10, check and define - does the same as Win32

GSR gsr.b3d at infernal-iceberg.com
Fri Dec 14 01:21:14 CET 2007


Hi,
ideasman42 at gmail.com (2007-12-13 at 1023.06 +0100):
> +// GCC 3.4.3 on solaris 10 dosnt have finite, win32 also just does this

No, in some cases it just avoids the checks completly (win32 <-> no
checks). What is more important, there are nice "FIXME" near the
tricky parts.

> +#ifndef finite
> +# define finite(x) (x>=0.0)
> +#endif

So all negatives are not finite? But positive inf is finite? C'mmon,
at least in the other places it had the FIXME. It just needs a bit of
investigation to get something more correct, instead of spreading bad
code over the files.

man finite 
[...]
 BSD floating point classification functions
[...]
       The finite() functions return a non-zero value if x is neither infinite
       nor a "not-a-number" (NaN) value, and 0 otherwise.
[...]
       Note that these functions are obsolete.  C99 defines macros isfinite(),
       isinf()  and isnan() (for all types) replacing them.  Further note that
       the C99 isinf() has weaker guarantees on the return value.  See fpclas-
       sify(3).

Maybe it can be workarounded with those C99 calls. Or maybe it
requires another header, the following looks like a way to catch old
Suns the same you hope to catch bananas saying "yellow monkey food"
instead of "banana" (ooh, boy, how I love lack of comments explaning
why things are done), so maybe the issue Solaris related.

#if !defined(linux) && (defined (__sparc) || defined (__sparc__))
#include <ieeefp.h>
#endif

GSR
 


More information about the Bf-committers mailing list