From 4194578ae8aa59115c80a7cad94e3b71b9858450 Mon Sep 17 00:00:00 2001 From: vms Date: Tue, 23 Apr 2019 00:37:03 +0300 Subject: [PATCH] Fix floatscan no long double usage (#21) * fix long double using in floatscan * define separate macroses for copysignl, fmodl, and scalbnl instead of #ifndef --- libc-top-half/headers/private/printscan.h | 6 ++++++ libc-top-half/musl/src/internal/floatscan.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libc-top-half/headers/private/printscan.h b/libc-top-half/headers/private/printscan.h index 273bc8e..af8cf89 100644 --- a/libc-top-half/headers/private/printscan.h +++ b/libc-top-half/headers/private/printscan.h @@ -37,6 +37,12 @@ typedef double long_double; #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #undef frexpl #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__)) static void long_double_not_supported(void) { void abort(void) __attribute__((__noreturn__)); diff --git a/libc-top-half/musl/src/internal/floatscan.c b/libc-top-half/musl/src/internal/floatscan.c index 3de2df5..7fd0060 100644 --- a/libc-top-half/musl/src/internal/floatscan.c +++ b/libc-top-half/musl/src/internal/floatscan.c @@ -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 */ for (y=i=0; i