aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-15 10:32:12 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-15 10:32:12 -0800
commit3753753c60a0b2ecb7ebd0475408c02cfff4ec91 (patch)
treef4e5935a4c0c07b0afbe5f7dfbe52852cb953e7a
parente808b59eb686e48f590e3d8ca2ab2671498f22b4 (diff)
remove musl use of fwritex1.8.13
-rw-r--r--system/lib/libc/musl/src/stdio/fputwc.c21
-rw-r--r--tools/shared.py2
2 files changed, 18 insertions, 5 deletions
diff --git a/system/lib/libc/musl/src/stdio/fputwc.c b/system/lib/libc/musl/src/stdio/fputwc.c
index e87e47d4..603fa615 100644
--- a/system/lib/libc/musl/src/stdio/fputwc.c
+++ b/system/lib/libc/musl/src/stdio/fputwc.c
@@ -17,15 +17,28 @@ wint_t __fputwc_unlocked(wchar_t c, FILE *f)
l = wctomb((void *)f->wpos, c);
if (l < 0) c = WEOF;
else f->wpos += l;
-#else
- if (isascii(c)) {
- c = fputc(c, f);
-#endif
} else {
l = wctomb(mbc, c);
if (l < 0 || __fwritex((void *)mbc, l, f) < l) c = WEOF;
}
return c;
+#else
+ if (isascii(c)) {
+ c = fputc(c, f);
+ } else {
+ l = wctomb(mbc, c);
+ if (l < 0) c = WEOF;
+ else {
+ for (int i = 0; i < l; i++) {
+ if (fputc(mbc[i], f) == EOF) {
+ c = WEOF;
+ break;
+ }
+ }
+ }
+ }
+#endif
+ return c;
}
wint_t fputwc(wchar_t c, FILE *f)
diff --git a/tools/shared.py b/tools/shared.py
index 4c89d2df..68b037f6 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -345,7 +345,7 @@ def find_temp_directory():
# we re-check sanity when the settings are changed)
# We also re-check sanity and clear the cache when the version changes
-EMSCRIPTEN_VERSION = '1.8.12'
+EMSCRIPTEN_VERSION = '1.8.13'
def generate_sanity():
return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT + '|' + get_clang_version()