|
From: Geoffrey H. <ge...@ge...> - 2007-02-21 15:27:57
|
On Feb 20, 2007, at 4:01 PM, Carsten Niehaus wrote: >> isnan() is included in the C99 standard as far I know. If this is >> unavailable >> >> #define *isnan*(x) ((x) != (x)) > What is the policy about OpenBabel and C99? For KDE4, C99 is still > not allowed > because the compiler/libs we use on all the differnt platforms > (linux, *bsd, > AIX, IRIX, windows, MacOS...) do in parts not support it... As OB > has the No, this is a good point. Not all compilers support C99 syntax, so we should attempt to not use it, or provide workarounds. For example, autoconf suggests a slightly different approach: http://www.gnu.org/software/autoconf/manual/html_node/Function- Portability.html > #include <math.h> > > #ifndef isnan > # define isnan(x) \ > (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ > : sizeof (x) == sizeof (double) ? isnan_d (x) \ > : isnan_f (x)) > static inline int isnan_f (float x) { return x != > x; } > static inline int isnan_d (double x) { return x != > x; } > static inline int isnan_ld (long double x) { return x != > x; } > #endif -Geoff |