OSDN Git Service

Guard the GNU strerror_r with an API check.
authorDan Albert <danalbert@google.com>
Wed, 15 Feb 2017 00:33:06 +0000 (16:33 -0800)
committerDan Albert <danalbert@google.com>
Wed, 15 Feb 2017 03:29:31 +0000 (19:29 -0800)
commit8b154b1e8233e1d34a6a66b72369f05f8655b653
treedd79c943d9db486842c8e4402cbd529ea2066f1d
parent9fc52deab1c6bec6a37860242eafe1ae4c205e44
Guard the GNU strerror_r with an API check.

The deprecated headers have always had only the POSIX definition
available (and it's always been available). With the unified headers
as they are now, we actually make it unavailable for C++ users (C++
implies _GNU_SOURCE) targeting below M. Adding this guard means that
pre-M users will still at least get the POSIX one.

It's not great that moving to M as your target API will actually
change the signature of your strerror_r, but I don't see a better
option here (not until we have the compatibility library, anyway).

Test: make checkbuild
Bug: None
Change-Id: I2d15702467533a826c4ec10fd973ee929d2b562a
libc/include/string.h