Commit 534a923a authored by Greg McGary's avatar Greg McGary Committed by Facebook Github Bot

Misc fixups to satisfy Android NDK unified headers

Summary:
Apply fixes that work with new unified headers and remain compatible with old per-API+arch headers.

I do this to unclutter the diff that enables unified headers, so that it only contains things that are incompatible with old per-API+arch headers.

Reviewed By: yfeldblum

Differential Revision: D10225372

fbshipit-source-id: b92cb3ef45cf23f2233c39520236c4531dba715b
parent c92fd042
......@@ -485,7 +485,14 @@ fbstring errnoStr(int err) {
result.assign(buf);
}
#elif defined(FOLLY_HAVE_XSI_STRERROR_R) || defined(__APPLE__) || \
defined(__ANDROID__)
(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
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