diff options
author | martin <martin> | 2005-06-22 22:05:34 +0000 |
---|---|---|
committer | martin <martin> | 2005-06-22 22:05:34 +0000 |
commit | 667ee40c4b8200477b35fda707039cc5a9e048ca (patch) | |
tree | 5cdd53ad3265071350a6557d43808ccbce3d8334 /www/firefox/patches/patch-cg | |
parent | 7df3f28fb144af29bdf3728f991f204649b9141b (diff) | |
download | pkgsrc-667ee40c4b8200477b35fda707039cc5a9e048ca.tar.gz |
Re-instantiate the NAN/INFINITY fixes, this time in a way that works on
older C environments as well.
Diffstat (limited to 'www/firefox/patches/patch-cg')
-rw-r--r-- | www/firefox/patches/patch-cg | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/www/firefox/patches/patch-cg b/www/firefox/patches/patch-cg new file mode 100644 index 00000000000..23911826632 --- /dev/null +++ b/www/firefox/patches/patch-cg @@ -0,0 +1,85 @@ +$NetBSD: patch-cg,v 1.4 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/base/Double.cpp.orig 2004-01-15 22:23:18.000000000 +0100 ++++ extensions/transformiix/source/base/Double.cpp 2005-06-20 11:26:26.000000000 +0200 +@@ -48,6 +48,38 @@ + * Utility class for doubles + */ + ++#if defined(INFINITY) && defined(NAN) ++double Double::NaN() ++{ ++ return NAN; ++} ++ ++double Double::PositiveInfinity() ++{ ++ return INFINITY; ++} ++ ++double Double::NegativeInfinity() ++{ ++ return -INFINITY; ++} ++ ++MBool Double::isInfinite(double aDbl) ++{ ++ return isinf(aDbl); ++} ++ ++MBool Double::isNaN(double aDbl) ++{ ++ return isnan(aDbl); ++} ++ ++MBool Double::isNeg(double aDbl) ++{ ++ return aDbl<0.0; ++} ++#else /* pre INFINITY C environment */ ++ + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D. + #ifdef __FreeBSD__ + #include <ieeefp.h> +@@ -127,9 +159,20 @@ + const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}; + #endif + +-const double Double::NaN = *((double*)nanMask); +-const double Double::POSITIVE_INFINITY = *((double*)infMask); +-const double Double::NEGATIVE_INFINITY = *((double*)negInfMask); ++double Double::NaN() ++{ ++ return *((double*)nanMask); ++} ++ ++double Double::PositiveInfinity() ++{ ++ return *((double*)infMask); ++} ++ ++double Double::NegativeInfinity() ++{ ++ return *((double*)negInfMask); ++} + + /* + * Determines whether the given double represents positive or negative +@@ -157,6 +200,7 @@ + { + return (TX_DOUBLE_HI32(aDbl) & TX_DOUBLE_HI32_SIGNBIT) != 0; + } ++#endif /* C environment has INFINITY and NAN */ + + /* + * Converts the given String to a double, if the String value does not +@@ -244,7 +288,7 @@ + { + if (mState == eIllegal || mBuffer.IsEmpty() || + (mBuffer.Length() == 1 && mBuffer[0] == '.')) { +- return Double::NaN; ++ return Double::NaN(); + } + return mSign*PR_strtod(mBuffer.get(), 0); + } + |