mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-18 12:30:28 +00:00
Fix nfds_t alias for Linux
This commit is contained in:
@@ -25,7 +25,7 @@ foreign lib {
|
||||
poll :: proc(fds: [^]pollfd, nfds: nfds_t, timeout: c.int) -> c.int ---
|
||||
}
|
||||
|
||||
when ODIN_OS == .Haiku {
|
||||
when ODIN_OS == .Haiku || ODIN_OS == .Linux {
|
||||
nfds_t :: c.ulong
|
||||
} else {
|
||||
nfds_t :: c.uint
|
||||
|
||||
@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
|
||||
printf("ai_canonname %zu\n", offsetof(struct addrinfo, ai_canonname));
|
||||
|
||||
printf("pollfd %zu %zu\n", sizeof(struct pollfd), _Alignof(struct pollfd));
|
||||
printf("nfds_t %zu %zu\n", sizeof(nfds_t), _Alignof(nfds_t));
|
||||
|
||||
printf("passwd %zu %zu\n", sizeof(struct passwd), _Alignof(struct passwd));
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ main :: proc() {
|
||||
fmt.println("ai_canonname", offset_of(posix.addrinfo, ai_canonname))
|
||||
|
||||
fmt.println("pollfd", size_of(posix.pollfd), align_of(posix.pollfd))
|
||||
fmt.println("nfds_t", size_of(posix.nfds_t), align_of(posix.nfds_t))
|
||||
|
||||
fmt.println("passwd", size_of(posix.passwd), align_of(posix.passwd))
|
||||
|
||||
when ODIN_OS != .Haiku {
|
||||
|
||||
Reference in New Issue
Block a user