mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -04:00
+ MACRO renaming cause complict with MS float.h
This commit is contained in:
parent
d3439a79bb
commit
9b1cc21c36
@ -98,8 +98,8 @@
|
|||||||
* for ten-to-e (just some small tables, e.g. of 10^k
|
* for ten-to-e (just some small tables, e.g. of 10^k
|
||||||
* for 0 <= k <= 22).
|
* for 0 <= k <= 22).
|
||||||
*/
|
*/
|
||||||
#define Honor_FLT_ROUNDS
|
#define Honor_CTPP2_FLT_ROUNDS
|
||||||
#define FLT_ROUNDS 3
|
#define CTPP2_FLT_ROUNDS 3
|
||||||
/*
|
/*
|
||||||
* #define IEEE_8087 for IEEE-arithmetic machines where the least
|
* #define IEEE_8087 for IEEE-arithmetic machines where the least
|
||||||
* significant byte has the lowest address.
|
* significant byte has the lowest address.
|
||||||
@ -110,10 +110,10 @@
|
|||||||
* #define VAX for VAX-style floating-point arithmetic (D_floating).
|
* #define VAX for VAX-style floating-point arithmetic (D_floating).
|
||||||
* #define No_leftright to omit left-right logic in fast floating-point
|
* #define No_leftright to omit left-right logic in fast floating-point
|
||||||
* computation of dtoa.
|
* computation of dtoa.
|
||||||
* #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
|
* #define Honor_CTPP2_FLT_ROUNDS if CTPP2_FLT_ROUNDS can assume the values 2 or 3
|
||||||
* and strtod and dtoa should round accordingly.
|
* and strtod and dtoa should round accordingly.
|
||||||
* #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
|
* #define Check_CTPP2_FLT_ROUNDS if CTPP2_FLT_ROUNDS can assume the values 2 or 3
|
||||||
* and Honor_FLT_ROUNDS is not #defined.
|
* and Honor_CTPP2_FLT_ROUNDS is not #defined.
|
||||||
* #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
|
* #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
|
||||||
* that use extended-precision instructions to compute rounded
|
* that use extended-precision instructions to compute rounded
|
||||||
* products and quotients) with IBM.
|
* products and quotients) with IBM.
|
||||||
@ -131,7 +131,7 @@
|
|||||||
* INT_64, #define #UINT_64 to be the corresponding unsigned type.
|
* INT_64, #define #UINT_64 to be the corresponding unsigned type.
|
||||||
* #define Bad_float_h if your system lacks a float.h or if it does not
|
* #define Bad_float_h if your system lacks a float.h or if it does not
|
||||||
* define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
|
* define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
|
||||||
* FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
|
* FLT_RADIX, CTPP2_FLT_ROUNDS, and DBL_MAX.
|
||||||
* #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
|
* #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
|
||||||
* if memory is available and otherwise does something you deem
|
* if memory is available and otherwise does something you deem
|
||||||
* appropriate. If MALLOC is undefined, malloc will be invoked
|
* appropriate. If MALLOC is undefined, malloc will be invoked
|
||||||
@ -275,24 +275,24 @@ typedef union
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef Flt_Rounds
|
#ifndef Flt_Rounds
|
||||||
#ifdef FLT_ROUNDS
|
#ifdef CTPP2_FLT_ROUNDS
|
||||||
#define Flt_Rounds FLT_ROUNDS
|
#define Flt_Rounds CTPP2_FLT_ROUNDS
|
||||||
#else
|
#else
|
||||||
#define Flt_Rounds 1
|
#define Flt_Rounds 1
|
||||||
#endif
|
#endif
|
||||||
#endif /*Flt_Rounds*/
|
#endif /*Flt_Rounds*/
|
||||||
|
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
#define Rounding rounding
|
#define Rounding rounding
|
||||||
#undef Check_FLT_ROUNDS
|
#undef Check_CTPP2_FLT_ROUNDS
|
||||||
#define Check_FLT_ROUNDS
|
#define Check_CTPP2_FLT_ROUNDS
|
||||||
#else
|
#else
|
||||||
#define Rounding Flt_Rounds
|
#define Rounding Flt_Rounds
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* ifndef IEEE_Arith */
|
#else /* ifndef IEEE_Arith */
|
||||||
#undef Check_FLT_ROUNDS
|
#undef Check_CTPP2_FLT_ROUNDS
|
||||||
#undef Honor_FLT_ROUNDS
|
#undef Honor_CTPP2_FLT_ROUNDS
|
||||||
#ifdef IBM
|
#ifdef IBM
|
||||||
#undef Flt_Rounds
|
#undef Flt_Rounds
|
||||||
#define Flt_Rounds 0
|
#define Flt_Rounds 0
|
||||||
@ -1101,8 +1101,8 @@ char * ctpp_dtoa(AllocatedBlock ** aBlocks, Bigint ** freelist, double dd, int m
|
|||||||
round-nearest mode) with the tests of mode 0 to
|
round-nearest mode) with the tests of mode 0 to
|
||||||
possibly return a shorter string that rounds to d.
|
possibly return a shorter string that rounds to d.
|
||||||
With IEEE arithmetic and compilation with
|
With IEEE arithmetic and compilation with
|
||||||
-DHonor_FLT_ROUNDS, modes 4 and 5 behave the same
|
-DHonor_CTPP2_FLT_ROUNDS, modes 4 and 5 behave the same
|
||||||
as modes 2 and 3 when FLT_ROUNDS != 1.
|
as modes 2 and 3 when CTPP2_FLT_ROUNDS != 1.
|
||||||
6-9 ==> Debugging modes similar to mode - 4: don't try
|
6-9 ==> Debugging modes similar to mode - 4: don't try
|
||||||
fast floating-point estimate (if applicable).
|
fast floating-point estimate (if applicable).
|
||||||
|
|
||||||
@ -1122,7 +1122,7 @@ char * ctpp_dtoa(AllocatedBlock ** aBlocks, Bigint ** freelist, double dd, int m
|
|||||||
U d, d2, eps;
|
U d, d2, eps;
|
||||||
double ds;
|
double ds;
|
||||||
char *s, *s0;
|
char *s, *s0;
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
int rounding;
|
int rounding;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1163,7 +1163,7 @@ char * ctpp_dtoa(AllocatedBlock ** aBlocks, Bigint ** freelist, double dd, int m
|
|||||||
return nrv_alloc(aBlocks, freelist, "0", rve, 1);
|
return nrv_alloc(aBlocks, freelist, "0", rve, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
if ((rounding = Flt_Rounds) >= 2)
|
if ((rounding = Flt_Rounds) >= 2)
|
||||||
{
|
{
|
||||||
if (*sign)
|
if (*sign)
|
||||||
@ -1271,7 +1271,7 @@ char * ctpp_dtoa(AllocatedBlock ** aBlocks, Bigint ** freelist, double dd, int m
|
|||||||
|
|
||||||
if (mode < 0 || mode > 9) { mode = 0; }
|
if (mode < 0 || mode > 9) { mode = 0; }
|
||||||
|
|
||||||
#ifdef Check_FLT_ROUNDS
|
#ifdef Check_CTPP2_FLT_ROUNDS
|
||||||
try_quick = Rounding == 1;
|
try_quick = Rounding == 1;
|
||||||
#else
|
#else
|
||||||
try_quick = 1;
|
try_quick = 1;
|
||||||
@ -1311,7 +1311,7 @@ char * ctpp_dtoa(AllocatedBlock ** aBlocks, Bigint ** freelist, double dd, int m
|
|||||||
}
|
}
|
||||||
s = s0 = rv_alloc(aBlocks, freelist, i);
|
s = s0 = rv_alloc(aBlocks, freelist, i);
|
||||||
|
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
if (mode > 1 && rounding != 1) { leftright = 0; }
|
if (mode > 1 && rounding != 1) { leftright = 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1458,8 +1458,8 @@ fast_failed:
|
|||||||
{
|
{
|
||||||
L = (INT_32)(dval(d) / ds);
|
L = (INT_32)(dval(d) / ds);
|
||||||
dval(d) -= L*ds;
|
dval(d) -= L*ds;
|
||||||
#ifdef Check_FLT_ROUNDS
|
#ifdef Check_CTPP2_FLT_ROUNDS
|
||||||
/* If FLT_ROUNDS == 2, L will usually be high by 1 */
|
/* If CTPP2_FLT_ROUNDS == 2, L will usually be high by 1 */
|
||||||
if (dval(d) < 0) {
|
if (dval(d) < 0) {
|
||||||
L--;
|
L--;
|
||||||
dval(d) += ds;
|
dval(d) += ds;
|
||||||
@ -1470,7 +1470,7 @@ fast_failed:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == ilim) {
|
if (i == ilim) {
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
if (mode > 1)
|
if (mode > 1)
|
||||||
switch(rounding) {
|
switch(rounding) {
|
||||||
case 0: goto ret1;
|
case 0: goto ret1;
|
||||||
@ -1553,7 +1553,7 @@ bump_up:
|
|||||||
|
|
||||||
spec_case = 0;
|
spec_case = 0;
|
||||||
if ((mode < 2 || leftright)
|
if ((mode < 2 || leftright)
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
&& rounding == 1
|
&& rounding == 1
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -1660,7 +1660,7 @@ bump_up:
|
|||||||
Bfree(freelist, delta);
|
Bfree(freelist, delta);
|
||||||
#ifndef ROUND_BIASED
|
#ifndef ROUND_BIASED
|
||||||
if (j1 == 0 && mode != 1 && !(word1(d) & 1)
|
if (j1 == 0 && mode != 1 && !(word1(d) & 1)
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
&& rounding >= 1
|
&& rounding >= 1
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -1683,7 +1683,7 @@ bump_up:
|
|||||||
{
|
{
|
||||||
goto accept_dig;
|
goto accept_dig;
|
||||||
}
|
}
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
if (mode > 1)
|
if (mode > 1)
|
||||||
{
|
{
|
||||||
switch(rounding)
|
switch(rounding)
|
||||||
@ -1692,7 +1692,7 @@ bump_up:
|
|||||||
case 2: goto keep_dig;
|
case 2: goto keep_dig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /*Honor_FLT_ROUNDS*/
|
#endif /*Honor_CTPP2_FLT_ROUNDS*/
|
||||||
if (j1 > 0)
|
if (j1 > 0)
|
||||||
{
|
{
|
||||||
b = lshift(aBlocks, freelist, b, 1);
|
b = lshift(aBlocks, freelist, b, 1);
|
||||||
@ -1705,7 +1705,7 @@ bump_up:
|
|||||||
}
|
}
|
||||||
if (j1 > 0)
|
if (j1 > 0)
|
||||||
{
|
{
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
if (!rounding) { goto accept_dig; }
|
if (!rounding) { goto accept_dig; }
|
||||||
#endif
|
#endif
|
||||||
if (dig == '9')
|
if (dig == '9')
|
||||||
@ -1719,7 +1719,7 @@ round_9_up:
|
|||||||
*s++ = dig + 1;
|
*s++ = dig + 1;
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
keep_dig:
|
keep_dig:
|
||||||
#endif
|
#endif
|
||||||
*s++ = dig;
|
*s++ = dig;
|
||||||
@ -1758,7 +1758,7 @@ keep_dig:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Round off last digit */
|
/* Round off last digit */
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
switch(rounding)
|
switch(rounding)
|
||||||
{
|
{
|
||||||
case 0: goto trimzeros;
|
case 0: goto trimzeros;
|
||||||
@ -1783,7 +1783,7 @@ roundoff:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef Honor_FLT_ROUNDS
|
#ifdef Honor_CTPP2_FLT_ROUNDS
|
||||||
trimzeros:
|
trimzeros:
|
||||||
#endif
|
#endif
|
||||||
while(*--s == '0') { ;; }
|
while(*--s == '0') { ;; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user