diff options
author | Dan Albert <danalbert@google.com> | 2014-06-04 09:53:06 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-06-04 12:01:56 -0700 |
commit | 001f8f041bf21c53d4a0b919ef2c859b047bac0a (patch) | |
tree | 4f53609088f6d2c5a53a73b03737fdb82c8a0f38 | |
parent | e120cba31df5249b720579312e799bd1c65f8e3d (diff) | |
download | bionic-001f8f041bf21c53d4a0b919ef2c859b047bac0a.zip bionic-001f8f041bf21c53d4a0b919ef2c859b047bac0a.tar.gz bionic-001f8f041bf21c53d4a0b919ef2c859b047bac0a.tar.bz2 |
Removes wcswcs from bionic for LP64.
Bug: 13935372
Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
-rw-r--r-- | libc/Android.mk | 1 | ||||
-rw-r--r-- | libc/bionic/ndk_cruft.cpp | 5 | ||||
-rw-r--r-- | libc/include/wchar.h | 1 | ||||
-rw-r--r-- | libc/upstream-openbsd/lib/libc/string/wcswcs.c | 5 | ||||
-rw-r--r-- | tests/wchar_test.cpp | 6 |
5 files changed, 6 insertions, 12 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index 77c77c8..ee8981a 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -481,7 +481,6 @@ libc_upstream_openbsd_src_files := \ upstream-openbsd/lib/libc/string/strtok.c \ upstream-openbsd/lib/libc/string/wcslcpy.c \ upstream-openbsd/lib/libc/string/wcsstr.c \ - upstream-openbsd/lib/libc/string/wcswcs.c \ upstream-openbsd/lib/libc/string/wcswidth.c \ libc_arch_static_src_files := \ diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 1284b9a..ed60ea4 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -40,6 +40,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> +#include <wchar.h> // These were accidentally declared in <unistd.h> because we stupidly used to inline // getpagesize() and __getpageshift(). Needed for backwards compatibility with old NDK apps. @@ -221,4 +222,8 @@ extern "C" int tkill(pid_t tid, int sig) { return syscall(__NR_tkill, tid, sig); } +extern "C" wchar_t* wcswcs(wchar_t* haystack, wchar_t* needle) { + return wcsstr(haystack, needle); +} + #endif diff --git a/libc/include/wchar.h b/libc/include/wchar.h index af7593f..d50e9ec 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -138,7 +138,6 @@ extern long long wcstoll(const wchar_t*, wchar_t**, int); extern long double wcstold(const wchar_t*, wchar_t**); extern unsigned long wcstoul(const wchar_t*, wchar_t**, int); extern unsigned long long wcstoull(const wchar_t*, wchar_t**, int); -extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); extern int wcswidth(const wchar_t *, size_t); extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); extern int wctob(wint_t); diff --git a/libc/upstream-openbsd/lib/libc/string/wcswcs.c b/libc/upstream-openbsd/lib/libc/string/wcswcs.c deleted file mode 100644 index bd35605..0000000 --- a/libc/upstream-openbsd/lib/libc/string/wcswcs.c +++ /dev/null @@ -1,5 +0,0 @@ -/* $OpenBSD: wcswcs.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ -/* $NetBSD: wcswcs.c,v 1.1 2003/03/05 20:18:17 tshiozak Exp $ */ - -#define WCSWCS -#include "wcsstr.c" diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index 5a250a2..e76026f 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -221,7 +221,7 @@ TEST(wchar, limits) { ASSERT_LT(WCHAR_MIN, WCHAR_MAX); } -TEST(wchar, wcsstr_wcswcs) { +TEST(wchar, wcsstr) { const wchar_t* haystack = L"matches hello world, not the second hello world"; const wchar_t* empty_needle = L""; const wchar_t* good_needle = L"ll"; @@ -230,10 +230,6 @@ TEST(wchar, wcsstr_wcswcs) { ASSERT_EQ(haystack, wcsstr(haystack, empty_needle)); ASSERT_EQ(&haystack[10], wcsstr(haystack, good_needle)); ASSERT_EQ(NULL, wcsstr(haystack, bad_needle)); - - ASSERT_EQ(haystack, wcswcs(haystack, empty_needle)); - ASSERT_EQ(&haystack[10], wcswcs(haystack, good_needle)); - ASSERT_EQ(NULL, wcswcs(haystack, bad_needle)); } TEST(wchar, mbtowc) { |