/* adjust for old MSVC */
#if defined(_MSC_VER) && (_MSC_VER < 1900)
-# define SNPRINTF _snprintf
+#define SNPRINTF _snprintf
#else
#define SNPRINTF snprintf
#endif
#endif /* !BUILDING_LIBCURL */
-#ifdef _WIN32
/* This is a helper function for Curl_strerror that converts Windows API error
* codes (GetLastError) to error messages.
* Returns NULL if no error message was found for error code.
return *buf ? buf : NULL;
}
-#endif /* _WIN32 */
const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen)
{
-#ifdef _WIN32
DWORD old_win_err = GetLastError();
-#endif
int old_errno = errno;
if(!buflen)
if(errno != old_errno)
CURL_SETERRNO(old_errno);
-#ifdef _WIN32
if(old_win_err != GetLastError())
SetLastError(old_win_err);
-#endif
return buf;
}