From 02f29e5e18fa01849e95bb329710cc05914eb997 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 16 Aug 2026 05:53:46 +0000 Subject: [PATCH] bionic diffs? --- src/common/error.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/error.cpp b/src/common/error.cpp index 070c9a5c7e..6678880a2c 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp @@ -33,8 +33,9 @@ std::string NativeErrorToString(int e) { return ret; #else char err_str[255]; -#if defined(__ANDROID__) || \ - (defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600))) + // Android >=24 API uses GNU specific, while lower API uses XSI compliant +#if (defined(__ANDROID__) && __ANDROID_API__ >= 24) \ + || (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);