Skip to content

Commit 21e0ec0

Browse files
committed
android: properly detect the GNU version of strerror_r()
1 parent 7104878 commit 21e0ec0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/shared/platform/posix/nacl_error.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@
1010
#include "native_client/src/include/build_config.h"
1111
#include "native_client/src/shared/platform/nacl_error.h"
1212

13+
#if defined(__native_client__)
14+
#define HAS_GNU_STRERROR_R
15+
#elif NACL_LINUX && !NACL_ANDROID
16+
#define HAS_GNU_STRERROR_R
17+
#elif NACL_ANDROID && (__ANDROID_MIN_SDK_VERSION__ > 22)
18+
#define HAS_GNU_STRERROR_R
19+
#endif
20+
1321
int NaClGetLastErrorString(char* buffer, size_t length) {
14-
#if defined(__native_client__) || (NACL_LINUX && !NACL_ANDROID)
22+
#if defined(HAS_GNU_STRERROR_R)
1523
char* message;
1624
/*
1725
* Note some Linux distributions and newlib provide only the GNU version of

0 commit comments

Comments
 (0)