LibTLS: Port to Windows
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
stasoid 2025-06-19 12:26:27 +05:00 committed by Andrew Kaster
commit 0e74736a53
Notes: github-actions[bot] 2025-06-24 00:59:08 +00:00
3 changed files with 10 additions and 3 deletions

View file

@ -10,6 +10,13 @@
#include <LibCrypto/OpenSSL.h>
#include <LibTLS/TLSv12.h>
#ifdef AK_OS_WINDOWS
# include <AK/Windows.h>
# define FD_SET_(fd, set) FD_SET(static_cast<SOCKET>(fd), set)
#else
# define FD_SET_ FD_SET
#endif
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
@ -32,7 +39,7 @@ static void wait_for_activity(int sock, bool read)
{
fd_set fds;
FD_ZERO(&fds);
FD_SET(sock, &fds);
FD_SET_(sock, &fds);
if (read)
select(sock + 1, &fds, nullptr, nullptr, nullptr);