Skip to content

Commit

Permalink
Use bionic's locale code.
Browse files Browse the repository at this point in the history
The old code worked fine for our limited use cases, but didn't match
with the bionic tests' expected values.

Test: ./checkbuild.py && ./run_tests.py
Bug: android/ndk#300
Change-Id: If94b56275ae86ce84e9d0e48f0118eb3b0fb224e
  • Loading branch information
DanAlbert committed Jul 12, 2017
1 parent f2a36f4 commit 14a246f
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 371 deletions.
7 changes: 2 additions & 5 deletions sources/android/support/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ android_support_c_includes += \
android_support_cflags += \
-include freebsd-compat.h \
-D_BSD_SOURCE \
-D__BIONIC_BUILD_FOR_ANDROID_SUPPORT \

android_support_sources := \
$(BIONIC_PATH)/libc/bionic/c32rtomb.cpp \
$(BIONIC_PATH)/libc/bionic/locale.cpp \
$(BIONIC_PATH)/libc/bionic/mbrtoc32.cpp \
$(BIONIC_PATH)/libc/bionic/mbstate.cpp \
$(BIONIC_PATH)/libc/bionic/wchar.cpp \
Expand Down Expand Up @@ -106,11 +108,6 @@ android_support_sources := \

# These are old sources that should be purged/rewritten/taken from bionic.
android_support_sources += \
src/locale/duplocale.c \
src/locale/freelocale.c \
src/locale/localeconv.c \
src/locale/newlocale.c \
src/locale/uselocale.c \
src/wchar_support.c \
src/wcstox/floatscan.c \
src/wcstox/intscan.c \
Expand Down
6 changes: 6 additions & 0 deletions sources/android/support/include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ unsigned long strtoul_l(const char* nptr, char** endptr, int base,
locale_t locale);
#endif // __ANDROID_API__ < 26

#if defined(MB_CUR_MAX)
size_t __ctype_get_mb_cur_max();
#undef MB_CUR_MAX
#define MB_CUR_MAX __ctype_get_mb_cur_max()
#endif // defined(MB_CUR_MAX)

__END_DECLS

#endif // NDK_ANDROID_SUPPORT_STDLIB_H
53 changes: 0 additions & 53 deletions sources/android/support/include/xlocale.h

This file was deleted.

43 changes: 0 additions & 43 deletions sources/android/support/src/locale/duplocale.c

This file was deleted.

34 changes: 0 additions & 34 deletions sources/android/support/src/locale/freelocale.c

This file was deleted.

35 changes: 0 additions & 35 deletions sources/android/support/src/locale/locale_impl.h

This file was deleted.

60 changes: 0 additions & 60 deletions sources/android/support/src/locale/localeconv.c

This file was deleted.

49 changes: 0 additions & 49 deletions sources/android/support/src/locale/newlocale.c

This file was deleted.

47 changes: 0 additions & 47 deletions sources/android/support/src/locale/setlocale.c

This file was deleted.

Loading

0 comments on commit 14a246f

Please sign in to comment.