Skip to content

Commit ef2ccf8

Browse files
committed
memory: stop overriding unused wcsdup()/_wcsdup() system functions
Also ban them via `checksrc`. The code continues to use `_tcsdup()`. Assisted-by: Daniel Stenberg Closes curl#17840
1 parent 7ae44fa commit ef2ccf8

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

lib/curl_memory.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@
6969

7070
#ifdef _WIN32
7171
# ifdef UNICODE
72-
# undef wcsdup
73-
# undef _wcsdup
7472
# undef _tcsdup
7573
# else
7674
# undef _tcsdup
@@ -155,10 +153,6 @@ extern curl_wcsdup_callback Curl_cwcsdup;
155153

156154
#ifdef _WIN32
157155
# ifdef UNICODE
158-
# undef wcsdup
159-
# define wcsdup(ptr) Curl_cwcsdup(ptr)
160-
# undef _wcsdup
161-
# define _wcsdup(ptr) Curl_cwcsdup(ptr)
162156
# undef _tcsdup
163157
# define _tcsdup(ptr) Curl_cwcsdup(ptr)
164158
# else

lib/memdebug.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ CURL_EXTERN ALLOC_FUNC
142142

143143
#ifdef _WIN32
144144
# ifdef UNICODE
145-
# undef wcsdup
146-
# define wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
147-
# undef _wcsdup
148-
# define _wcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
149145
# undef _tcsdup
150146
# define _tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
151147
# else

scripts/checksrc.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
"_tcsncat" => 1,
6666
"_wcscat" => 1,
6767
"_wcsncat" => 1,
68+
"_wcsdup" => 1,
69+
"wcsdup" => 1,
6870
"LoadLibrary" => 1,
6971
"LoadLibraryA" => 1,
7072
"LoadLibraryW" => 1,

0 commit comments

Comments
 (0)