diff --git a/libc/build.mak b/libc/build.mak index 325f080917c6ae28a577e55b9a928fa53620cbce..9277a1a87c7bf1ee8eb317ec945522438aa38dff 100644 --- a/libc/build.mak +++ b/libc/build.mak @@ -1,6 +1,6 @@ libc := -libc += internal/floatscan.o +#libc += internal/floatscan.o libc += internal/intscan.o libc += internal/libc.o libc += internal/__lock.o diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c index 6a19c31dba583278233b5a13317f47d2866dd023..31db27f65454741425e29fc5f2d8183b6d2e4246 100644 --- a/libc/stdio/vfprintf.c +++ b/libc/stdio/vfprintf.c @@ -200,6 +200,7 @@ static char *fmt_u(uintmax_t x, char *s) return s; } +#ifdef HAVE_FLOAT_SUPPORT static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) { uint32_t big[(LDBL_MAX_EXP+LDBL_MANT_DIG)/9+1]; @@ -430,6 +431,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) return MAX(w, pl+l); } +#endif /* HAVE_FLOAT_SUPPORT */ static int getint(char **s) { int i; @@ -618,10 +620,12 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, pad(f, ' ', w, p, fl^LEFT_ADJ); l = w>p ? w : p; continue; +#ifdef HAVE_FLOAT_SUPPORT case 'e': case 'f': case 'g': case 'a': case 'E': case 'F': case 'G': case 'A': l = fmt_fp(f, arg.f, w, p, fl, t); continue; +#endif } if (p < z-a) p = z-a; diff --git a/libc/stdio/vfscanf.c b/libc/stdio/vfscanf.c index 86f92f9f27b21fdaa73f09e8bfd9758aa41f5052..62f3dcbeec1ce5ab8283f9130ddc8715c450ae86 100644 --- a/libc/stdio/vfscanf.c +++ b/libc/stdio/vfscanf.c @@ -85,7 +85,9 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) int invert; int matches=0; unsigned long long x; +#ifdef HAVE_FLOAT_SUPPORT long double y; +#endif off_t pos = 0; FLOCK(f); @@ -284,6 +286,7 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) if (t=='p' && dest) *(void **)dest = (void *)(uintptr_t)x; else store_int(dest, size, x); break; +#ifdef HAVE_FLOAT_SUPPORT case 'a': case 'A': case 'e': case 'E': case 'f': case 'F': @@ -302,6 +305,7 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) break; } break; +#endif case 'S': wcs = dest; st = (mbstate_t){ 0 };