summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xgeneric/tclStrToD.c18
2 files changed, 13 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index f8abf8a..79b3a80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
* changes: Updated for 8.5.2 release.
+ * generic/tclStrToD.c: Resolve identifier conflict over "pow10"
+ with libm in Cygwin and DJGPP. Thanks to Gordon Schumacher and
+ Philip Moore. [Patch 1800636]
+
2008-03-12 Daniel Steffen <das@users.sourceforge.net>
* macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 8e4cead..e5e863b 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStrToD.c,v 1.32 2007/12/13 15:23:20 dgp Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.33 2008/03/13 17:14:19 dgp Exp $
*
*----------------------------------------------------------------------
*/
@@ -83,7 +83,7 @@ static int maxpow10_wide; /* The powers of ten that can be represented
* exactly as wide integers. */
static Tcl_WideUInt *pow10_wide;
#define MAXPOW 22
-static double pow10[MAXPOW+1]; /* The powers of ten that can be represented
+static double pow10vals[MAXPOW+1]; /* The powers of ten that can be represented
* exactly as IEEE754 doubles. */
static int mmaxpow; /* Largest power of ten that can be
* represented exactly in a 'double'. */
@@ -1323,7 +1323,7 @@ MakeLowPrecisionDouble(
* without special handling.
*/
- retval = (double)(Tcl_WideInt)significand * pow10[ exponent ];
+ retval = (double)(Tcl_WideInt)significand * pow10vals[ exponent ];
goto returnValue;
} else {
int diff = DBL_DIG - numSigDigs;
@@ -1336,8 +1336,8 @@ MakeLowPrecisionDouble(
*/
volatile double factor =
- (double)(Tcl_WideInt)significand * pow10[diff];
- retval = factor * pow10[exponent-diff];
+ (double)(Tcl_WideInt)significand * pow10vals[diff];
+ retval = factor * pow10vals[exponent-diff];
goto returnValue;
}
}
@@ -1349,7 +1349,7 @@ MakeLowPrecisionDouble(
* only one rounding.
*/
- retval = (double)(Tcl_WideInt)significand / pow10[-exponent];
+ retval = (double)(Tcl_WideInt)significand / pow10vals[-exponent];
goto returnValue;
}
}
@@ -2178,7 +2178,7 @@ TclInitDoubleConversion(void)
mmaxpow = MAXPOW;
}
for (i=0 ; i<=mmaxpow ; ++i) {
- pow10[i] = d;
+ pow10vals[i] = d;
d *= 10.0;
}
@@ -2571,7 +2571,7 @@ Pow10TimesFrExp(
* Multiply by 10**exponent
*/
- retval = frexp(retval * pow10[exponent&0xf], &j);
+ retval = frexp(retval * pow10vals[exponent&0xf], &j);
expt += j;
for (i=4; i<9; ++i) {
if (exponent & (1<<i)) {
@@ -2584,7 +2584,7 @@ Pow10TimesFrExp(
* Divide by 10**-exponent
*/
- retval = frexp(retval / pow10[(-exponent) & 0xf], &j);
+ retval = frexp(retval / pow10vals[(-exponent) & 0xf], &j);
expt += j;
for (i=4; i<9; ++i) {
if ((-exponent) & (1<<i)) {