From 458f80f482a201b427a1c92235804d0c3f98fd51 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 2 Sep 2017 13:01:11 -0700
Subject: [PATCH 3/4] Conditionalize glibc specific strerror_r

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp    | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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
index 4e7badb14a..0eeae884e2 100644
--- 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
@@ -97,17 +97,14 @@ public:
 #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
     using namespace std;
     return strerror(value);
-#elif defined(__MACH__) && defined(__APPLE__) \
-  || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
-  || defined(_AIX) || defined(__hpux) || defined(__osf__) \
-  || defined(__ANDROID__)
+#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
+    char buf[256] = "";
+    return strerror_r(value, buf, sizeof(buf));
+#else
     char buf[256] = "";
     using namespace std;
     strerror_r(value, buf, sizeof(buf));
     return buf;
-#else
-    char buf[256] = "";
-    return strerror_r(value, buf, sizeof(buf));
 #endif
 #endif // defined(ASIO_WINDOWS)
   }
-- 
2.14.1

