diff options
author | Kevin B Kenny <kennykb@acm.org> | 2008-03-30 04:26:15 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2008-03-30 04:26:15 (GMT) |
commit | e5f1969c3350cce0f8cac276147a55961f9418d4 (patch) | |
tree | d371ccb1926cceb68ac8480d22ead45c57e7f3b4 /generic/tclInt.h | |
parent | 0c13b42b7fd7d214470460a9d63384166982ab11 (diff) | |
download | tcl-e5f1969c3350cce0f8cac276147a55961f9418d4.zip tcl-e5f1969c3350cce0f8cac276147a55961f9418d4.tar.gz tcl-e5f1969c3350cce0f8cac276147a55961f9418d4.tar.bz2 |
* generic/tclInt.h (TclIsNaN):
* unix/configure.in: Added code to the configurator to check for
a standard isnan() macro and use it if one
is found. This change avoids bugs where
the test of ((d) != (d)) is optimized away
by an overaggressive compiler. [Bug 1783544]
* unix/configure: autoconf-2.61
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 23c8adb..e513663 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.362 2008/01/23 21:32:36 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.363 2008/03/30 04:26:16 kennykb Exp $ */ #ifndef _TCLINT @@ -3768,11 +3768,15 @@ MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, */ #ifdef _MSC_VER -#define TclIsInfinite(d) ( ! (_finite((d))) ) -#define TclIsNaN(d) (_isnan((d))) +# define TclIsInfinite(d) ( ! (_finite((d))) ) +# define TclIsNaN(d) (_isnan((d))) #else -#define TclIsInfinite(d) ( (d) > DBL_MAX || (d) < -DBL_MAX ) -#define TclIsNaN(d) ((d) != (d)) +# define TclIsInfinite(d) ( (d) > DBL_MAX || (d) < -DBL_MAX ) +# ifdef NO_ISNAN +# define TclIsNaN(d) ((d) != (d)) +# else +# define TclIsNaN(d) (isnan(d)) +# endif #endif /* |