mirror of
https://github.com/curl/curl.git
synced 2026-08-04 07:40:03 +03:00
windows: use _strdup() instead of strdup() where missing
To replace deprecated `strdup()` CRT calls with the recommended `_strdup()`. Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup-mbsdup Closes #19794
This commit is contained in:
parent
a3fcd80de4
commit
5356bce6ab
5 changed files with 14 additions and 8 deletions
|
|
@ -36,7 +36,11 @@
|
|||
curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc;
|
||||
curl_free_callback Curl_cfree = (curl_free_callback)free;
|
||||
curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc;
|
||||
#ifdef _WIN32
|
||||
curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)_strdup;
|
||||
#else
|
||||
curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup;
|
||||
#endif
|
||||
curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
|
||||
|
||||
#if defined(_MSC_VER) && defined(_DLL)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ extern const struct entry_s s_entries[];
|
|||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define strdup _strdup
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
|
||||
#elif defined(HAVE_STRCASECMP)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue