mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:57:28 +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
|
|
@ -38,12 +38,6 @@ int main(void)
|
|||
}
|
||||
#else
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE /* for strdup() */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
|
||||
#undef _WIN32_WINNT
|
||||
|
|
@ -52,6 +46,7 @@ int main(void)
|
|||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <windows.h>
|
||||
#define strdup _strdup
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue