diff options
| author | Jukka Jylänki <jujjyl@gmail.com> | 2014-05-20 12:15:27 +0300 |
|---|---|---|
| committer | Jukka Jylänki <jujjyl@gmail.com> | 2014-05-23 02:20:06 +0300 |
| commit | c81baafb6a516c0bfef67751df1dcd19a0a9c750 (patch) | |
| tree | 6dbd0d9a4dec7f7fc5ba27922a650c696a3c89bb /system | |
| parent | 955e7442312dd16b627d375c3726fa580dcdd465 (diff) | |
Migrate snprintf to musl. Move the most common sprintf-related code to libc instead of libcextra to avoid pulling libcextra in on common runs.
Diffstat (limited to 'system')
| -rw-r--r-- | system/lib/libc.symbols | 11 | ||||
| -rw-r--r-- | system/lib/libc/musl/src/stdio/snprintf.c | 13 | ||||
| -rw-r--r-- | system/lib/libcextra.symbols | 10 |
3 files changed, 24 insertions, 10 deletions
diff --git a/system/lib/libc.symbols b/system/lib/libc.symbols index d889d509..28e959d9 100644 --- a/system/lib/libc.symbols +++ b/system/lib/libc.symbols @@ -56,6 +56,9 @@ W bulk_free W calloc W free + T frexp + T frexpf + T frexpl W independent_calloc W independent_comalloc T isdigit @@ -72,14 +75,18 @@ W malloc_usable_size W mallopt W memalign + T MUSL_vfprintf W posix_memalign W pvalloc W realloc W realloc_in_place T scalbn T scalbnl + T memchr T memcmp T memcpy + T snprintf + T sprintf T strtod T strtoull T strtoll @@ -101,3 +108,7 @@ T strtold_l T tolower W valloc + T vsnprintf + T vsprintf + T wcrtomb + T wctomb diff --git a/system/lib/libc/musl/src/stdio/snprintf.c b/system/lib/libc/musl/src/stdio/snprintf.c new file mode 100644 index 00000000..771503b2 --- /dev/null +++ b/system/lib/libc/musl/src/stdio/snprintf.c @@ -0,0 +1,13 @@ +#include <stdio.h> +#include <stdarg.h> + +int snprintf(char *restrict s, size_t n, const char *restrict fmt, ...) +{ + int ret; + va_list ap; + va_start(ap, fmt); + ret = vsnprintf(s, n, fmt, ap); + va_end(ap); + return ret; +} + diff --git a/system/lib/libcextra.symbols b/system/lib/libcextra.symbols index 32fb23e1..1ab849bd 100644 --- a/system/lib/libcextra.symbols +++ b/system/lib/libcextra.symbols @@ -34,9 +34,6 @@ T fcvt T fputwc W fputwc_unlocked - T frexp - T frexpf - T frexpl T fwprintf T gcvt T getopt @@ -117,7 +114,6 @@ T mbstowcs T mbtowc T memccpy - T memchr T memmem T mempcpy W memrchr @@ -167,7 +163,6 @@ T strverscmp T strxfrm W strxfrm_l - T sprintf T swprintf T tgamma T tgammaf @@ -187,10 +182,7 @@ T verrx T MUSL_vfscanf T vsscanf - T MUSL_vfprintf T vfwprintf - T vsnprintf - T vsprintf T vswprintf T vwarn T vwarnx @@ -199,7 +191,6 @@ T warnx T wcpcpy T wcpncpy - T wcrtomb T wcscasecmp T wcscasecmp_l T wcscat @@ -239,7 +230,6 @@ T wcsxfrm T wcsxfrm_l T wctob - T wctomb T wctrans T wctrans_l T wctype |
