]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds
authorViktor Szakats <commit@vsz.me>
Mon, 1 Dec 2025 19:08:09 +0000 (20:08 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 1 Dec 2025 20:32:10 +0000 (21:32 +0100)
Follow-up to ccb68d2e3b602b24a8cb52f473b96938ac998db6 #19790

Closes #19796

lib/curlx/multibyte.c
lib/curlx/multibyte.h

index fb3b7be3e12057a24cb6da3675017c2798212062..3a33fcedfc65b91ba409522827cb0d9119f8a361 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "../curl_setup.h"
 
-#ifdef _WIN32
+#if defined(_WIN32) && defined(UNICODE)
 
 #include "multibyte.h"
 
@@ -81,4 +81,4 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w)
   return str_utf8;
 }
 
-#endif /* _WIN32 */
+#endif /* _WIN32 && UNICODE */
index 3eae4e75bd1f1bfcecc21643b40bba0c8eef6b9c..fd264e180efa29365bc2127e4fa75523903c378e 100644 (file)
 #define CURLX_FREE(x)   curlx_free(x)
 #endif
 
-/* MultiByte conversions using Windows kernel32 library. */
-wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8);
-char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w);
-
 /* the purpose of this macro is to free() without being traced by memdebug */
 #define curlx_unicodefree(ptr) CURLX_FREE(ptr)
 
 #ifdef UNICODE
 
+/* MultiByte conversions using Windows kernel32 library. */
+wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8);
+char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w);
+
 #define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr))
 #define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr))