mirror of
https://github.com/curl/curl.git
synced 2026-08-24 11:43:38 +03:00
windows: USE_WINSOCK to guard winsock2 code (where missing)
Replacing `_WIN32`. Also: - tool_doswin: guard possibly non-portable socket code with `USE_WINSOCK`. The socket is cast to `HANDLE` and passed to win32 API `SetStdHandle(STD_INPUT_HANDLE, ...)`. - lib/setup-win32.h: move `#undef`s before their `#define` pair. Closes #20455
This commit is contained in:
parent
a4e2232c43
commit
2f7d37f54a
6 changed files with 16 additions and 14 deletions
|
|
@ -693,6 +693,7 @@ static void init_terminal(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
/* The following STDIN non - blocking read techniques are heavily inspired
|
||||
by nmap and ncat (https://nmap.org/ncat/) */
|
||||
struct win_thread_data {
|
||||
|
|
@ -895,6 +896,7 @@ curl_socket_t win32_stdin_read_thread(void)
|
|||
assert(socket_r != CURL_SOCKET_BAD);
|
||||
return socket_r;
|
||||
}
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
#endif /* !CURL_WINDOWS_UWP */
|
||||
|
||||
|
|
|
|||
|
|
@ -1119,7 +1119,7 @@ static void check_stdin_upload(struct OperationConfig *config,
|
|||
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
if(!strcmp(per->uploadfile, ".")) {
|
||||
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
|
||||
#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP)
|
||||
/* non-blocking stdin behavior on Windows is challenging
|
||||
Spawn a new thread that will read from stdin and write
|
||||
out to a socket */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue