Spread module custom data to all threads, enable libc-builtin float print (#633)

This commit is contained in:
Xu Jun
2021-05-19 14:57:31 +08:00
committed by GitHub
parent a14a4487bb
commit f637438e4e
12 changed files with 88 additions and 11 deletions

View File

@ -361,6 +361,19 @@ handle_1_to_9:
break;
}
case 'f': {
float64 f64;
char buf[16], *s;
CHECK_VA_ARG(ap, float64);
f64 = _va_arg(ap, float64);
snprintf(buf, sizeof(buf), "%f", f64);
s = buf;
while (*s)
out((int) (*s++), ctx);
break;
}
default:
out((int) '%', ctx);
out((int) *fmt, ctx);