libc++: Add wchar support wrappers.

This implements many missing wchar-related functions needed to build the library.

This will probably better placed in its own static library in the future.

Note that this reimplements the functions for all API levels. This is because
of the following situation:

- Before API level 9, The NDK <wchar.h> defines wchar_t as 'unsigned char'
  and all implemented functions (e.g. wcslen()) by the system's C library
  are just stub to their string version (e.g. wcslen() -> strlen()).

  There was no official support for wchar_t in Bionic. The existing
  header was only used to be able to build the GNU toolchain with it.

- After API level 9, wchar_t switched to a 32-bit type, and wchar
  functions were implemented correctly, though some of them are
  missing.

By reimplementing everything, there is no need to check for the target
API level, and the resulting libraries will work on all Android systems.

Change-Id: I1cc42e32ab4be9ca68697dcac319d2cbba5a0ace
2 files changed