]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: drop unused include and duplicate guards
authorViktor Szakats <commit@vsz.me>
Sat, 4 Oct 2025 01:11:09 +0000 (03:11 +0200)
committerViktor Szakats <commit@vsz.me>
Sat, 4 Oct 2025 09:34:42 +0000 (11:34 +0200)
Closes #18839

lib/curlx/winapi.c
lib/strerror.c

index 6069424becc55a66689fb4b698c253463cc5e870..7e3d1aa9ca9af8a33a6a144519b60c432869a01f 100644 (file)
 
 /* 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;
 }
index f0f36ed1b716df8b47ef4079a4a6dbae4c108d4d..cf0876564f37a14db5facc60b1930f315abd448e 100644 (file)
 
 #include <curl/curl.h>
 
-#ifdef USE_LIBIDN2
-#include <idn2.h>
-#endif
-
 #ifdef USE_WINDOWS_SSPI
 #include "curl_sspi.h"
 #endif