From: Viktor Szakats Date: Mon, 7 Jul 2025 09:46:26 +0000 (+0200) Subject: memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions X-Git-Tag: rc-8_15_0-3~21 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef2ccf862f8fbfe5cb86cb716aead57694a95ef5;p=thirdparty%2Fcurl.git memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions Also ban them via `checksrc`. The code continues to use `_tcsdup()`. Assisted-by: Daniel Stenberg Closes #17840 --- diff --git a/lib/curl_memory.h b/lib/curl_memory.h index df64786e8a..41933d6af9 100644 --- a/lib/curl_memory.h +++ b/lib/curl_memory.h @@ -69,8 +69,6 @@ #ifdef _WIN32 # ifdef UNICODE -# undef wcsdup -# undef _wcsdup # undef _tcsdup # else # undef _tcsdup @@ -155,10 +153,6 @@ extern curl_wcsdup_callback Curl_cwcsdup; #ifdef _WIN32 # ifdef UNICODE -# undef wcsdup -# define wcsdup(ptr) Curl_cwcsdup(ptr) -# undef _wcsdup -# define _wcsdup(ptr) Curl_cwcsdup(ptr) # undef _tcsdup # define _tcsdup(ptr) Curl_cwcsdup(ptr) # else diff --git a/lib/memdebug.h b/lib/memdebug.h index 2038dc34d3..e109e0b20a 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -142,10 +142,6 @@ CURL_EXTERN ALLOC_FUNC #ifdef _WIN32 # ifdef UNICODE -# undef wcsdup -# define wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) -# undef _wcsdup -# define _wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) # undef _tcsdup # define _tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) # else diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 47ea1cf54a..8dbb3f384e 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -65,6 +65,8 @@ my %banfunc = ( "_tcsncat" => 1, "_wcscat" => 1, "_wcsncat" => 1, + "_wcsdup" => 1, + "wcsdup" => 1, "LoadLibrary" => 1, "LoadLibraryA" => 1, "LoadLibraryW" => 1,