diff --git a/socks.h b/socks.h index a481a98..82bfa2f 100644 --- a/socks.h +++ b/socks.h @@ -79,7 +79,9 @@ inline void sock_close(SOCKET s) inline const char* sock_strerror(char* buf, size_t len) { buf[0] = '\0'; -#if defined(__APPLE__) || defined(__FreeBSD__) + +#if defined(__APPLE__) || defined(__FreeBSD__) || !defined(_GNU_SOURCE) || !defined(__GLIBC__) + strerror_r(errno, buf, len); return buf; #else