diff options
author | Elliott Hughes <enh@google.com> | 2014-04-04 17:34:51 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-04-07 14:29:28 -0700 |
commit | 77e944fd46728075fe632bcb5211da9daf5b7e68 (patch) | |
tree | 078c4ed4dcd4a8d857aa948de76dec223c588e0d /libc/include | |
parent | dc5fcf3620bfc221954b3d42f459bfdcf8f48216 (diff) | |
download | android_bionic-77e944fd46728075fe632bcb5211da9daf5b7e68.tar.gz android_bionic-77e944fd46728075fe632bcb5211da9daf5b7e68.tar.bz2 android_bionic-77e944fd46728075fe632bcb5211da9daf5b7e68.zip |
Implement wctomb(3) for ltrace.
This is an implementation in the style of the rest: char == byte.
We might want to come back and implement UTF-8, but this is enough for ltrace.
Bug: 13747066
Change-Id: Ib2b63609c9014fdef9a8491e067467c4fc5ae3cc
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/stdlib.h | 2 | ||||
-rw-r--r-- | libc/include/wchar.h | 14 |
2 files changed, 3 insertions, 13 deletions
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 9b7e6d16a..5dbcb3d7d 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -151,7 +151,6 @@ extern lldiv_t lldiv(long long, long long); extern const char* getprogname(void); extern void setprogname(const char*); -#if 1 /* MISSING FROM BIONIC - ENABLED FOR STLPort and libstdc++-v3 */ /* make STLPort happy */ extern int mblen(const char *, size_t); extern size_t mbstowcs(wchar_t *, const char *, size_t); @@ -160,7 +159,6 @@ extern int mbtowc(wchar_t *, const char *, size_t); /* Likewise, make libstdc++-v3 happy. */ extern int wctomb(char *, wchar_t); extern size_t wcstombs(char *, const wchar_t *, size_t); -#endif /* MISSING */ #define MB_CUR_MAX 1 diff --git a/libc/include/wchar.h b/libc/include/wchar.h index 32cf12763..89c6fb603 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -36,13 +36,6 @@ #include <time.h> #include <malloc.h> -/* IMPORTANT: Any code that relies on wide character support is essentially - * non-portable and/or broken. the only reason this header exist - * is because I'm really a nice guy. However, I'm not nice enough - * to provide you with a real implementation. instead wchar_t == char - * and all wc functions are stubs to their "normal" equivalent... - */ - __BEGIN_DECLS typedef __WINT_TYPE__ wint_t; @@ -150,12 +143,11 @@ extern int wscanf(const wchar_t *, ...); extern size_t wcslcat(wchar_t*, const wchar_t*, size_t); extern size_t wcslcpy(wchar_t*, const wchar_t*, size_t); -/* No really supported. These are just for making libstdc++-v3 happy. */ typedef void *wctrans_t; -extern wint_t towctrans(wint_t, wctrans_t); -extern wctrans_t wctrans (const char *); +extern wint_t towctrans(wint_t, wctrans_t); +extern wctrans_t wctrans(const char*); -#if _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +#if __POSIX_VISIBLE >= 200809 wchar_t* wcsdup(const wchar_t*); size_t wcsnlen(const wchar_t*, size_t); #endif |