aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-12-17 23:37:37 -0800
committerbunnei <bunneidev@gmail.com>2023-06-03 00:05:27 -0700
commitc5b29ef3b7566530fcd400c53a5b5b3f91ff8a51 (patch)
tree0936c10fe320c1f049b8f362f373df306c7db74a
parent48835ce81bbda0858268454bf1547a6f04873357 (diff)
common: error: Fix for Android.
-rw-r--r--src/common/error.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/error.cpp b/src/common/error.cpp
index ddb03bd459..1b2009db71 100644
--- a/src/common/error.cpp
+++ b/src/common/error.cpp
@@ -30,7 +30,8 @@ std::string NativeErrorToString(int e) {
return ret;
#else
char err_str[255];
-#if defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600))
+#if defined(ANDROID) || \
+ (defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600)))
// Thread safe (GNU-specific)
const char* str = strerror_r(e, err_str, sizeof(err_str));
return std::string(str);