Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 458f80f482a201b427a1c92235804d0c3f98fd51 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 2 Sep 2017 13:01:11 -0700 |
| 4 | Subject: [PATCH 3/4] Conditionalize glibc specific strerror_r |
| 5 | |
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 7 | --- |
| 8 | .../asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp | 11 ++++------- |
| 9 | 1 file changed, 4 insertions(+), 7 deletions(-) |
| 10 | |
| 11 | diff --git a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp |
| 12 | index 4e7badb14a..0eeae884e2 100644 |
| 13 | --- a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp |
| 14 | +++ b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp |
| 15 | @@ -97,17 +97,14 @@ public: |
| 16 | #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__) |
| 17 | using namespace std; |
| 18 | return strerror(value); |
| 19 | -#elif defined(__MACH__) && defined(__APPLE__) \ |
| 20 | - || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \ |
| 21 | - || defined(_AIX) || defined(__hpux) || defined(__osf__) \ |
| 22 | - || defined(__ANDROID__) |
| 23 | +#elif defined(__GLIBC__) && defined(_GNU_SOURCE) |
| 24 | + char buf[256] = ""; |
| 25 | + return strerror_r(value, buf, sizeof(buf)); |
| 26 | +#else |
| 27 | char buf[256] = ""; |
| 28 | using namespace std; |
| 29 | strerror_r(value, buf, sizeof(buf)); |
| 30 | return buf; |
| 31 | -#else |
| 32 | - char buf[256] = ""; |
| 33 | - return strerror_r(value, buf, sizeof(buf)); |
| 34 | #endif |
| 35 | #endif // defined(ASIO_WINDOWS) |
| 36 | } |
| 37 | -- |
| 38 | 2.14.1 |
| 39 | |