mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibCore/LibIPC/Meta: Stop using deprecated Winsock functions
This commit stops using deprecated WSA functions. While the ANSI versions are most likely not going anywhere, Windows is natively UTF-16 so it has to convert to ANSI internally. All the ANSI functions in Winsock are marked as deprecated. The macro suppressing the warnings is no longer defined.
This commit is contained in:
Notes:
github-actions[bot]
2026-02-06 10:46:34 +00:00
Author: https://github.com/R-Goc Commit: https://github.com/LadybirdBrowser/ladybird/commit/3a86e779bd8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7515 Reviewed-by: https://github.com/gmta ✅
@@ -213,10 +213,10 @@ ErrorOr<int> dup(int handle)
|
||||
return Error::from_windows_error(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
if (is_socket(handle)) {
|
||||
WSAPROTOCOL_INFO pi = {};
|
||||
if (WSADuplicateSocket(handle, GetCurrentProcessId(), &pi))
|
||||
WSAPROTOCOL_INFOW pi = {};
|
||||
if (WSADuplicateSocketW(handle, GetCurrentProcessId(), &pi))
|
||||
return Error::from_windows_error();
|
||||
SOCKET socket = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
|
||||
SOCKET socket = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
|
||||
if (socket == INVALID_SOCKET)
|
||||
return Error::from_windows_error();
|
||||
return socket;
|
||||
|
||||
Reference in New Issue
Block a user