Skip to content

Commit

Permalink
Fix incorrect API level for wcstombs and mbstowcs.
Browse files Browse the repository at this point in the history
Mbstowcs and wcstombs cannot get correct return value when called in the environment below api 21, and need to raise the API level to solve the problem.

Test: None
fix bug 1108 android/ndk#1108

Change-Id: Iabcf1bff0be087288646687732ef68870630b48a
  • Loading branch information
ZijunZhaoCCK authored and HyperN00B committed May 19, 2022
1 parent 0142857 commit 28d50b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libc/include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ const char* getprogname(void) __INTRODUCED_IN(21);
void setprogname(const char* __name) __INTRODUCED_IN(21);

int mblen(const char* __s, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
size_t mbstowcs(wchar_t* __dst, const char* __src, size_t __n);
size_t mbstowcs(wchar_t* __dst, const char* __src, size_t __n) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD;
int mbtowc(wchar_t* __wc_ptr, const char* __s, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
int wctomb(char* __dst, wchar_t __wc) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);

size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n);
size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD;

#if __ANDROID_API__ >= 21
size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);
Expand Down
4 changes: 2 additions & 2 deletions libc/libc.map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ LIBC {
mbsinit;
mbsnrtowcs; # introduced=21
mbsrtowcs;
mbstowcs;
mbstowcs; # introduced=21
mbtowc; # introduced=21
memalign;
memccpy;
Expand Down Expand Up @@ -1194,7 +1194,7 @@ LIBC {
wcstold_l; # introduced=21
wcstoll; # introduced=21
wcstoll_l; # introduced=21
wcstombs;
wcstombs; # introduced=21
wcstoul;
wcstoull; # introduced=21
wcstoull_l; # introduced=21
Expand Down

0 comments on commit 28d50b8

Please sign in to comment.