From 1dc735bf64bfde087c0d004e8be14987af19c6dc Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 7 Mar 2017 22:18:05 +0000 Subject: [PATCH] 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 --- openmp/runtime/src/kmp_i18n.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openmp/runtime/src/kmp_i18n.cpp b/openmp/runtime/src/kmp_i18n.cpp index ea4f30e13854..992d1fedea2d 100644 --- a/openmp/runtime/src/kmp_i18n.cpp +++ b/openmp/runtime/src/kmp_i18n.cpp @@ -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.