Fix GNU strerror_r check for Android.

Summary:
Bionic didn't get a GNU style strerror_r until Android M. Until then
we unconditionally exposed the POSIX one. Expand the check to account
for this.

Reviewers: pirama, AndreyChurbanov, jlpeyton

Reviewed By: jlpeyton

Subscribers: openmp-commits, srhines

Differential Revision: https://reviews.llvm.org/D30056

llvm-svn: 297235
This commit is contained in:
Dan Albert 2017-03-07 22:18:05 +00:00
parent 14ab3e6885
commit 1dc735bf64
1 changed files with 3 additions and 1 deletions

View File

@ -819,7 +819,9 @@ sys_error(
int strerror_r( int, char *, size_t ); // XSI version
*/
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || \
(defined(__BIONIC__) && defined(_GNU_SOURCE) && \
__ANDROID_API__ >= __ANDROID_API_M__)
// GNU version of strerror_r.