From eb93ebffba21e2c9b8a12bb86db60d38c7750270 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 1 Mar 2013 18:35:56 -0800 Subject: [PATCH] Switch to upstream-freebsd for the unmolested wchar code. Change-Id: I87b4d76ff8da04109ae53638eec4f11629798960 --- libc/Android.mk | 54 +++++++++---------- libc/include/wchar.h | 5 ++ .../lib/libc/string}/wcpcpy.c | 0 .../lib/libc/string}/wcpncpy.c | 0 .../lib/libc/string}/wcscasecmp.c | 0 .../lib/libc/string}/wcscat.c | 0 .../lib/libc/string}/wcschr.c | 0 .../lib/libc/string}/wcscmp.c | 0 .../lib/libc/string}/wcscpy.c | 0 .../lib/libc/string}/wcscspn.c | 0 .../lib/libc/string}/wcsdup.c | 0 .../lib/libc/string}/wcslcat.c | 0 .../lib/libc/string}/wcslcpy.c | 0 .../lib/libc/string}/wcslen.c | 0 .../lib/libc/string}/wcsncasecmp.c | 0 .../lib/libc/string}/wcsncat.c | 0 .../lib/libc/string}/wcsncmp.c | 0 .../lib/libc/string}/wcsncpy.c | 0 .../lib/libc/string}/wcsnlen.c | 0 .../lib/libc/string}/wcspbrk.c | 0 .../lib/libc/string}/wcsrchr.c | 0 .../lib/libc/string}/wcsspn.c | 0 .../lib/libc/string}/wcsstr.c | 0 .../lib/libc/string}/wcstok.c | 0 .../lib/libc/string}/wmemchr.c | 0 .../lib/libc/string}/wmemcmp.c | 0 .../lib/libc/string}/wmemcpy.c | 0 .../lib/libc/string}/wmemmove.c | 0 .../lib/libc/string}/wmemset.c | 0 29 files changed, 32 insertions(+), 27 deletions(-) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcpcpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcpncpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcscasecmp.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcscat.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcschr.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcscmp.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcscpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcscspn.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsdup.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcslcat.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcslcpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcslen.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsncasecmp.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsncat.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsncmp.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsncpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsnlen.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcspbrk.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsrchr.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsspn.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcsstr.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wcstok.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wmemchr.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wmemcmp.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wmemcpy.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wmemmove.c (100%) rename libc/{wchar => upstream-freebsd/lib/libc/string}/wmemset.c (100%) diff --git a/libc/Android.mk b/libc/Android.mk index a8b4ebdd5..884d759b8 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -111,35 +111,8 @@ libc_common_src_files := \ string/strspn.c \ string/strstr.c \ string/strtok.c \ - wchar/wcpcpy.c \ - wchar/wcpncpy.c \ - wchar/wcscasecmp.c \ - wchar/wcscat.c \ - wchar/wcschr.c \ - wchar/wcscmp.c \ - wchar/wcscpy.c \ - wchar/wcscspn.c \ - wchar/wcsdup.c \ - wchar/wcslcat.c \ - wchar/wcslcpy.c \ - wchar/wcslen.c \ - wchar/wcsncasecmp.c \ - wchar/wcsncat.c \ - wchar/wcsncmp.c \ - wchar/wcsncpy.c \ - wchar/wcsnlen.c \ - wchar/wcspbrk.c \ - wchar/wcsrchr.c \ - wchar/wcsspn.c \ - wchar/wcsstr.c \ - wchar/wcstok.c \ wchar/wcswidth.c \ wchar/wcsxfrm.c \ - wchar/wmemchr.c \ - wchar/wmemcmp.c \ - wchar/wmemcpy.c \ - wchar/wmemmove.c \ - wchar/wmemset.c \ tzcode/asctime.c \ tzcode/difftime.c \ tzcode/localtime.c \ @@ -318,6 +291,33 @@ libc_bionic_src_files := \ libc_upstream_freebsd_src_files := \ upstream-freebsd/lib/libc/stdlib/realpath.c \ + upstream-freebsd/lib/libc/string/wcpcpy.c \ + upstream-freebsd/lib/libc/string/wcpncpy.c \ + upstream-freebsd/lib/libc/string/wcscasecmp.c \ + upstream-freebsd/lib/libc/string/wcscat.c \ + upstream-freebsd/lib/libc/string/wcschr.c \ + upstream-freebsd/lib/libc/string/wcscmp.c \ + upstream-freebsd/lib/libc/string/wcscpy.c \ + upstream-freebsd/lib/libc/string/wcscspn.c \ + upstream-freebsd/lib/libc/string/wcsdup.c \ + upstream-freebsd/lib/libc/string/wcslcat.c \ + upstream-freebsd/lib/libc/string/wcslcpy.c \ + upstream-freebsd/lib/libc/string/wcslen.c \ + upstream-freebsd/lib/libc/string/wcsncasecmp.c \ + upstream-freebsd/lib/libc/string/wcsncat.c \ + upstream-freebsd/lib/libc/string/wcsncmp.c \ + upstream-freebsd/lib/libc/string/wcsncpy.c \ + upstream-freebsd/lib/libc/string/wcsnlen.c \ + upstream-freebsd/lib/libc/string/wcspbrk.c \ + upstream-freebsd/lib/libc/string/wcsrchr.c \ + upstream-freebsd/lib/libc/string/wcsspn.c \ + upstream-freebsd/lib/libc/string/wcsstr.c \ + upstream-freebsd/lib/libc/string/wcstok.c \ + upstream-freebsd/lib/libc/string/wmemchr.c \ + upstream-freebsd/lib/libc/string/wmemcmp.c \ + upstream-freebsd/lib/libc/string/wmemcpy.c \ + upstream-freebsd/lib/libc/string/wmemmove.c \ + upstream-freebsd/lib/libc/string/wmemset.c \ libc_upstream_netbsd_src_files := \ upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ diff --git a/libc/include/wchar.h b/libc/include/wchar.h index ef88e043b..a4e19f09a 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -149,6 +149,11 @@ typedef void *wctrans_t; extern wint_t towctrans(wint_t, wctrans_t); extern wctrans_t wctrans (const char *); +#if _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +wchar_t* wcsdup(const wchar_t*); +size_t wcsnlen(const wchar_t*, size_t); +#endif + __END_DECLS #endif /* _WCHAR_H_ */ diff --git a/libc/wchar/wcpcpy.c b/libc/upstream-freebsd/lib/libc/string/wcpcpy.c similarity index 100% rename from libc/wchar/wcpcpy.c rename to libc/upstream-freebsd/lib/libc/string/wcpcpy.c diff --git a/libc/wchar/wcpncpy.c b/libc/upstream-freebsd/lib/libc/string/wcpncpy.c similarity index 100% rename from libc/wchar/wcpncpy.c rename to libc/upstream-freebsd/lib/libc/string/wcpncpy.c diff --git a/libc/wchar/wcscasecmp.c b/libc/upstream-freebsd/lib/libc/string/wcscasecmp.c similarity index 100% rename from libc/wchar/wcscasecmp.c rename to libc/upstream-freebsd/lib/libc/string/wcscasecmp.c diff --git a/libc/wchar/wcscat.c b/libc/upstream-freebsd/lib/libc/string/wcscat.c similarity index 100% rename from libc/wchar/wcscat.c rename to libc/upstream-freebsd/lib/libc/string/wcscat.c diff --git a/libc/wchar/wcschr.c b/libc/upstream-freebsd/lib/libc/string/wcschr.c similarity index 100% rename from libc/wchar/wcschr.c rename to libc/upstream-freebsd/lib/libc/string/wcschr.c diff --git a/libc/wchar/wcscmp.c b/libc/upstream-freebsd/lib/libc/string/wcscmp.c similarity index 100% rename from libc/wchar/wcscmp.c rename to libc/upstream-freebsd/lib/libc/string/wcscmp.c diff --git a/libc/wchar/wcscpy.c b/libc/upstream-freebsd/lib/libc/string/wcscpy.c similarity index 100% rename from libc/wchar/wcscpy.c rename to libc/upstream-freebsd/lib/libc/string/wcscpy.c diff --git a/libc/wchar/wcscspn.c b/libc/upstream-freebsd/lib/libc/string/wcscspn.c similarity index 100% rename from libc/wchar/wcscspn.c rename to libc/upstream-freebsd/lib/libc/string/wcscspn.c diff --git a/libc/wchar/wcsdup.c b/libc/upstream-freebsd/lib/libc/string/wcsdup.c similarity index 100% rename from libc/wchar/wcsdup.c rename to libc/upstream-freebsd/lib/libc/string/wcsdup.c diff --git a/libc/wchar/wcslcat.c b/libc/upstream-freebsd/lib/libc/string/wcslcat.c similarity index 100% rename from libc/wchar/wcslcat.c rename to libc/upstream-freebsd/lib/libc/string/wcslcat.c diff --git a/libc/wchar/wcslcpy.c b/libc/upstream-freebsd/lib/libc/string/wcslcpy.c similarity index 100% rename from libc/wchar/wcslcpy.c rename to libc/upstream-freebsd/lib/libc/string/wcslcpy.c diff --git a/libc/wchar/wcslen.c b/libc/upstream-freebsd/lib/libc/string/wcslen.c similarity index 100% rename from libc/wchar/wcslen.c rename to libc/upstream-freebsd/lib/libc/string/wcslen.c diff --git a/libc/wchar/wcsncasecmp.c b/libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c similarity index 100% rename from libc/wchar/wcsncasecmp.c rename to libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c diff --git a/libc/wchar/wcsncat.c b/libc/upstream-freebsd/lib/libc/string/wcsncat.c similarity index 100% rename from libc/wchar/wcsncat.c rename to libc/upstream-freebsd/lib/libc/string/wcsncat.c diff --git a/libc/wchar/wcsncmp.c b/libc/upstream-freebsd/lib/libc/string/wcsncmp.c similarity index 100% rename from libc/wchar/wcsncmp.c rename to libc/upstream-freebsd/lib/libc/string/wcsncmp.c diff --git a/libc/wchar/wcsncpy.c b/libc/upstream-freebsd/lib/libc/string/wcsncpy.c similarity index 100% rename from libc/wchar/wcsncpy.c rename to libc/upstream-freebsd/lib/libc/string/wcsncpy.c diff --git a/libc/wchar/wcsnlen.c b/libc/upstream-freebsd/lib/libc/string/wcsnlen.c similarity index 100% rename from libc/wchar/wcsnlen.c rename to libc/upstream-freebsd/lib/libc/string/wcsnlen.c diff --git a/libc/wchar/wcspbrk.c b/libc/upstream-freebsd/lib/libc/string/wcspbrk.c similarity index 100% rename from libc/wchar/wcspbrk.c rename to libc/upstream-freebsd/lib/libc/string/wcspbrk.c diff --git a/libc/wchar/wcsrchr.c b/libc/upstream-freebsd/lib/libc/string/wcsrchr.c similarity index 100% rename from libc/wchar/wcsrchr.c rename to libc/upstream-freebsd/lib/libc/string/wcsrchr.c diff --git a/libc/wchar/wcsspn.c b/libc/upstream-freebsd/lib/libc/string/wcsspn.c similarity index 100% rename from libc/wchar/wcsspn.c rename to libc/upstream-freebsd/lib/libc/string/wcsspn.c diff --git a/libc/wchar/wcsstr.c b/libc/upstream-freebsd/lib/libc/string/wcsstr.c similarity index 100% rename from libc/wchar/wcsstr.c rename to libc/upstream-freebsd/lib/libc/string/wcsstr.c diff --git a/libc/wchar/wcstok.c b/libc/upstream-freebsd/lib/libc/string/wcstok.c similarity index 100% rename from libc/wchar/wcstok.c rename to libc/upstream-freebsd/lib/libc/string/wcstok.c diff --git a/libc/wchar/wmemchr.c b/libc/upstream-freebsd/lib/libc/string/wmemchr.c similarity index 100% rename from libc/wchar/wmemchr.c rename to libc/upstream-freebsd/lib/libc/string/wmemchr.c diff --git a/libc/wchar/wmemcmp.c b/libc/upstream-freebsd/lib/libc/string/wmemcmp.c similarity index 100% rename from libc/wchar/wmemcmp.c rename to libc/upstream-freebsd/lib/libc/string/wmemcmp.c diff --git a/libc/wchar/wmemcpy.c b/libc/upstream-freebsd/lib/libc/string/wmemcpy.c similarity index 100% rename from libc/wchar/wmemcpy.c rename to libc/upstream-freebsd/lib/libc/string/wmemcpy.c diff --git a/libc/wchar/wmemmove.c b/libc/upstream-freebsd/lib/libc/string/wmemmove.c similarity index 100% rename from libc/wchar/wmemmove.c rename to libc/upstream-freebsd/lib/libc/string/wmemmove.c diff --git a/libc/wchar/wmemset.c b/libc/upstream-freebsd/lib/libc/string/wmemset.c similarity index 100% rename from libc/wchar/wmemset.c rename to libc/upstream-freebsd/lib/libc/string/wmemset.c