Commit 488cc1c3 authored by Greg McGary's avatar Greg McGary Committed by Facebook Github Bot

Configure FOLLY_HAVE_XSI_STRERROR_R in buck for fbandroid

Summary: For determining proper use of `strerror_r` based on available decl, move messy `#if` logic out of `String.cpp` and into buck config.

Reviewed By: yfeldblum

Differential Revision: D10243924

fbshipit-source-id: 6c10fc43562765c158d13ed74961277b633bb606
parent 25b51f24
...@@ -484,14 +484,7 @@ fbstring errnoStr(int err) { ...@@ -484,14 +484,7 @@ fbstring errnoStr(int err) {
} else { } else {
result.assign(buf); result.assign(buf);
} }
#elif defined(FOLLY_HAVE_XSI_STRERROR_R) || defined(__APPLE__) || \ #elif FOLLY_HAVE_XSI_STRERROR_R || defined(__APPLE__)
(defined(__ANDROID__) && \
!(defined(_STRING_H) && defined(__USE_GNU) && __ANDROID_API__ >= 23))
// Above: _STRING_H (no trailing underscore) guards unified NDK headers
// vs. _STRING_H_ which guards old per-API+arch NDK headers.
// Old non-unified headers always declare strerror_r as XSI compatible.
// New unified headers declare it as XSI compatible for API<23,
// but as GNU-compatible (with return type char*) for API>=23.
// Using XSI-compatible strerror_r // Using XSI-compatible strerror_r
int r = strerror_r(err, buf, sizeof(buf)); int r = strerror_r(err, buf, sizeof(buf));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment