Skip to content

Commit 850a96e

Browse files
[nrf toup] Do not use GNU strerror while using Zephyr
In some cases GNU_SOURCE may be enabled and due to that a wrong strerror implementation is used for Zephyr platform. To prevent this, exclude ZEPHYR if GNU_SOURCE is enabled. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent 914b6b8 commit 850a96e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/system/SystemError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DLL_EXPORT const char * DescribeErrorPOSIX(CHIP_ERROR aError)
9191
#endif // CHIP_SYSTEM_CONFIG_THREAD_LOCAL_STORAGE
9292

9393
// Use thread-safe strerror_r when available
94-
#if defined(_GNU_SOURCE) && !defined(__ANDROID__) && !defined(__Fuchsia__) && !defined(__MUSL__)
94+
#if defined(_GNU_SOURCE) && !defined(__ANDROID__) && !defined(__Fuchsia__) && !defined(__MUSL__) && !defined(__ZEPHYR__)
9595
// GNU version returns char*
9696
const char * s = strerror_r(lError, errBuf, sizeof(errBuf));
9797
if (s != nullptr)

0 commit comments

Comments
 (0)