mirror of
https://github.com/curl/curl.git
synced 2026-07-26 02:47:18 +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
|
|
@ -91,8 +91,7 @@
|
|||
#pragma warning(disable:4127)
|
||||
/* Avoid VS2005 and upper complaining about portable C functions. */
|
||||
#ifndef _CRT_NONSTDC_NO_DEPRECATE /* mingw-w64 v2+. MS SDK ~10+/~VS2017+. */
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE /* for close(), fileno(), strdup(),
|
||||
unlink(), etc. */
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE /* for close(), fileno(), unlink(), etc. */
|
||||
#endif
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS /* for getenv(), gmtime(), strcpy(),
|
||||
|
|
|
|||
|
|
@ -103,7 +103,11 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT;
|
|||
* so the callback pointer is initialized correctly.
|
||||
*/
|
||||
#ifdef HAVE_STRDUP
|
||||
#ifdef _WIN32
|
||||
#define system_strdup _strdup
|
||||
#else
|
||||
#define system_strdup strdup
|
||||
#endif
|
||||
#else
|
||||
#define system_strdup Curl_strdup
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue