mirror of
https://git.proxmox.com/git/wasi-libc
synced 2025-08-07 09:33:13 +00:00
Fix floatscan no long double usage (#21)
* fix long double using in floatscan * define separate macroses for copysignl, fmodl, and scalbnl instead of #ifndef
This commit is contained in:
parent
29d45024c7
commit
4194578ae8
@ -37,6 +37,12 @@ typedef double long_double;
|
|||||||
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
|
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
|
||||||
#undef frexpl
|
#undef frexpl
|
||||||
#define frexpl(x, exp) frexp(x, exp)
|
#define frexpl(x, exp) frexp(x, exp)
|
||||||
|
#undef copysignl
|
||||||
|
#define copysignl(x, y) copysign(x, y)
|
||||||
|
#undef fmodl
|
||||||
|
#define fmodl(x, y) fmod(x, y)
|
||||||
|
#undef scalbnl
|
||||||
|
#define scalbnl(arg, exp) scalbn(arg, exp)
|
||||||
__attribute__((__cold__, __noreturn__))
|
__attribute__((__cold__, __noreturn__))
|
||||||
static void long_double_not_supported(void) {
|
static void long_double_not_supported(void) {
|
||||||
void abort(void) __attribute__((__noreturn__));
|
void abort(void) __attribute__((__noreturn__));
|
||||||
|
@ -287,7 +287,11 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
|
|||||||
/* Assemble desired bits into floating point variable */
|
/* Assemble desired bits into floating point variable */
|
||||||
for (y=i=0; i<LD_B1B_DIG; i++) {
|
for (y=i=0; i<LD_B1B_DIG; i++) {
|
||||||
if ((a+i & MASK)==z) x[(z=(z+1 & MASK))-1] = 0;
|
if ((a+i & MASK)==z) x[(z=(z+1 & MASK))-1] = 0;
|
||||||
|
#if defined(__wasilibc_printscan_no_long_double)
|
||||||
|
y = 1000000000.0 * y + x[a+i & MASK];
|
||||||
|
#else
|
||||||
y = 1000000000.0L * y + x[a+i & MASK];
|
y = 1000000000.0L * y + x[a+i & MASK];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
y *= sign;
|
y *= sign;
|
||||||
|
Loading…
Reference in New Issue
Block a user