blob: 1591f94c966d662ff4fc306d3424e7004e1e6d74 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 458f80f482a201b427a1c92235804d0c3f98fd51 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 13:01:11 -0700
4Subject: [PATCH 3/4] Conditionalize glibc specific strerror_r
5
6Signed-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
11diff --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
12index 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--
382.14.1
39