common: error: Fix for Android.

merge-requests/60/head
bunnei 2022-12-17 23:37:37 +07:00
parent f8b87e6fab
commit cdbab60bbb
1 changed files with 2 additions and 1 deletions

@ -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);