From: Francesco Chemolli Date: Sun, 7 Aug 2011 09:56:35 +0000 (+1200) Subject: Windows: sys_nerr is not available on MinGW. X-Git-Tag: take08~55^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21e543593103b9fec2dcae254be790f60da98737;p=thirdparty%2Fsquid.git Windows: sys_nerr is not available on MinGW. --- diff --git a/compat/xstrerror.cc b/compat/xstrerror.cc index eae455adcd..f496a327f2 100644 --- a/compat/xstrerror.cc +++ b/compat/xstrerror.cc @@ -83,13 +83,11 @@ xstrerr(int error) #if _SQUID_WINDOWS_ // Description of WSAGetLastError() - if (error < 0 || error >= sys_nerr) { - for (size_t i = 0;i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) { - if (_wsaerrtext[i].err == error) { - // small optimization, save using a temporary buffer and two copies... - snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc); - return xstrerror_buf; - } + for (size_t i = 0;i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) { + if (_wsaerrtext[i].err == error) { + // small optimization, save using a temporary buffer and two copies... + snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc); + return xstrerror_buf; } } #endif