From: Viktor Szakats Date: Sat, 4 Oct 2025 01:11:09 +0000 (+0200) Subject: lib: drop unused include and duplicate guards X-Git-Tag: rc-8_17_0-2~258 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9edc26afedefc9ce338a72910b8bd9616e8ebca;p=thirdparty%2Fcurl.git lib: drop unused include and duplicate guards Closes #18839 --- diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index 6069424bec..7e3d1aa9ca 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -38,14 +38,13 @@ /* 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. @@ -86,13 +85,10 @@ const char *curlx_get_winapi_error(int err, char *buf, size_t buflen) 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) @@ -125,10 +121,8 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen) if(errno != old_errno) CURL_SETERRNO(old_errno); -#ifdef _WIN32 if(old_win_err != GetLastError()) SetLastError(old_win_err); -#endif return buf; } diff --git a/lib/strerror.c b/lib/strerror.c index f0f36ed1b7..cf0876564f 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -34,10 +34,6 @@ #include -#ifdef USE_LIBIDN2 -#include -#endif - #ifdef USE_WINDOWS_SSPI #include "curl_sspi.h" #endif