feat(udp): Udp.* - polled IPv4 datagrams on macOS and Windows

Udp.open/port/send/recv/from_ip/from_port/close/resolve/local_ip/ip/ip_text, native
BSD sockets (udp.ll) and Winsock (udp_win.ll, -lws2_32), linked only when a program
uses Udp.*; example, docs and tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-17 11:16:14 +03:00
parent 6a7f1dd393
commit ebb1a00352
24 changed files with 68630 additions and 66360 deletions

View file

@ -273,6 +273,12 @@ entry {
if g_target_win { cmd = `{cmd} {join_path(home, "runtime/native/threads_win.ll")}` }
else { cmd = `{cmd} {join_path(home, "runtime/native/threads.ll")}` }
}
# Udp.* links the socket layer: BSD sockets from libSystem on macOS, Winsock (ws2_32) on
# Windows.
if g_uses_udp {
if g_target_win { cmd = `{cmd} {join_path(home, "runtime/native/udp_win.ll")} -lws2_32` }
else { cmd = `{cmd} {join_path(home, "runtime/native/udp.ll")}` }
}
if g_uses_http {
if g_target_win {
let httpw = join_path(home, "runtime/native/http_win.ll")