aboutsummaryrefslogtreecommitdiffstats
path: root/community/asio/fix-strerror_r.patch
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-04-21 14:14:57 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-04-21 14:44:37 +0000
commitce70b431e56abd102144a28b14bdd47d26457dc6 (patch)
tree4a804cd69c32de29c33bf1074b883b8081d33292 /community/asio/fix-strerror_r.patch
parentbf8f6d8dd9ac29b0146b6cc7eb235d936ae7ad15 (diff)
downloadaports-ce70b431e56abd102144a28b14bdd47d26457dc6.tar.bz2
aports-ce70b431e56abd102144a28b14bdd47d26457dc6.tar.xz
community/asio: moved from testing
Diffstat (limited to 'community/asio/fix-strerror_r.patch')
-rw-r--r--community/asio/fix-strerror_r.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/community/asio/fix-strerror_r.patch b/community/asio/fix-strerror_r.patch
new file mode 100644
index 0000000000..f05a519c81
--- /dev/null
+++ b/community/asio/fix-strerror_r.patch
@@ -0,0 +1,42 @@
+From 52d862c4e8af60a31f0067e1070b8625e805cdc3 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 21 Jan 2016 23:37:32 +0100
+Subject: [PATCH] Fix use of strerror_r()
+
+Don't try keep track of all platforms which follows posix standard.
+Instead, make the platform which don't follow standard to an exception
+and fall back to standard implementation for everything else.
+
+This fixes building with musl libc.
+
+Fixes #94
+---
+ asio/include/asio/impl/error_code.ipp | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/asio/include/asio/impl/error_code.ipp b/asio/include/asio/impl/error_code.ipp
+index b996773..3a1cff1 100644
+--- a/include/asio/impl/error_code.ipp
++++ b/include/asio/impl/error_code.ipp
+@@ -98,17 +98,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_DESKTOP) || defined(__CYGWIN__)
+ }