0003-Conditionalize-glibc-specific-strerror_r.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  6. ---
  7. .../asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp | 11 ++++-------
  8. 1 file changed, 4 insertions(+), 7 deletions(-)
  9. 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
  10. index 4e7badb14a..0eeae884e2 100644
  11. --- a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
  12. +++ b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
  13. @@ -97,17 +97,14 @@ public:
  14. #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
  15. using namespace std;
  16. return strerror(value);
  17. -#elif defined(__MACH__) && defined(__APPLE__) \
  18. - || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
  19. - || defined(_AIX) || defined(__hpux) || defined(__osf__) \
  20. - || defined(__ANDROID__)
  21. +#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
  22. + char buf[256] = "";
  23. + return strerror_r(value, buf, sizeof(buf));
  24. +#else
  25. char buf[256] = "";
  26. using namespace std;
  27. strerror_r(value, buf, sizeof(buf));
  28. return buf;
  29. -#else
  30. - char buf[256] = "";
  31. - return strerror_r(value, buf, sizeof(buf));
  32. #endif
  33. #endif // defined(ASIO_WINDOWS)
  34. }
  35. --
  36. 2.14.1