Repository navigation
Make sleep() propagate error.Canceled - #53
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces cancellation support to sleep operations by changing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* Add getaddrinfo and getnameinfo wrappers Add cross-platform wrappers for getaddrinfo/getnameinfo to prepare for Zig 0.16 migration where std.posix is being removed. - Add getaddrinfo() wrapper with support for both Windows and POSIX - Add getnameinfo() wrapper with NI packed struct for flags - Define Windows extern functions and addrinfo struct (removed from ws2_32) - Add comprehensive error conversion for both platforms - Handle EAI.SYSTEM by reading actual errno value - Add tests for resolving example.com and reverse lookup of 127.0.0.1 * Fix NI type compatibility across platforms Copy NI definitions from Zig 0.16 std.c to ensure compatibility across all platforms (Linux, BSD variants, Illumos, Serenity, etc.). Previously, std.c.NI was void for FreeBSD and other platforms not explicitly supported in Zig 0.15.2, causing compilation errors. This adds explicit packed struct definitions for all platforms based on their platform-specific getnameinfo flags. * Add custom getnameinfo extern for BSD platforms On BSD platforms (FreeBSD, NetBSD, OpenBSD, etc.), std.c.NI is void in Zig 0.15.2, which causes std.c.getnameinfo to have an invalid signature (void parameters not allowed). This adds a custom extern declaration that takes c_int for flags instead of the problematic NI type, and uses it for platforms where std.c.NI is not properly defined. Split getnameinfo implementation: - Use std.c.getnameinfo for Linux, Emscripten, Illumos, Serenity - Use posix_extern.getnameinfo for BSD and other platforms * Remove getnameinfo wrapper Remove getnameinfo wrapper due to cross-platform NI type compatibility issues on macOS/BSD. The getaddrinfo wrapper remains functional and is sufficient for the Zig 0.16 migration. Removed: - NI type definitions for all platforms - getnameinfo() function - GetNameInfoError error set - errnoToGetNameInfoError() function - posix_extern struct - windows_NI type - getnameinfo test * Fix Windows calling convention to lowercase Change callconv(std.os.windows.WINAPI) to callconv(.winapi) in Windows extern function declarations. The calling convention should use the lowercase .winapi syntax.
Summary by CodeRabbit
New Features
Improvements