Skip to content

Commit 73f863a

Browse files
lalinskyalexrp
authored andcommitted
Fix AI/NI flag definitions for BSD systems
Add missing AI flags for NetBSD and OpenBSD: - NetBSD: Add AI.SRV flag at bit 11 (0x00000800) - OpenBSD: Add AI.EXT flag at bit 3 and AI.FQDN flag at bit 5 Add missing NI (getnameinfo) flag definitions for all BSDs and Darwin: - FreeBSD/Haiku: NOFQDN, NUMERICHOST, NAMEREQD, NUMERICSERV, DGRAM, NUMERICSCOPE - DragonFly/NetBSD: Same flags with NUMERICSCOPE at bit 6 (deprecated WITHSCOPEID at bit 5 is skipped) - OpenBSD: NUMERICHOST, NUMERICSERV, NOFQDN, NAMEREQD, DGRAM (no NUMERICSCOPE) - macOS/Darwin: NOFQDN, NUMERICHOST, NAMEREQD, NUMERICSERV, DGRAM, NUMERICSCOPE at bit 8 (deprecated WITHSCOPEID at bit 5 is skipped) References: - NetBSD: https://github.com/NetBSD/src/blob/trunk/include/netdb.h - OpenBSD: https://github.com/openbsd/src/blob/master/include/netdb.h - FreeBSD: https://github.com/freebsd/freebsd-src/blob/master/include/netdb.h - DragonFly BSD: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/include/netdb.h - Haiku: https://github.com/haiku/haiku/blob/master/headers/posix/netdb.h - macOS/Darwin: https://github.com/apple-oss-distributions/Libinfo/blob/main/lookup.subproj/netdb.h
1 parent f0a3df9 commit 73f863a

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

lib/std/c.zig

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7269,7 +7269,8 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
72697269
NUMERICSERV: bool = false,
72707270
_4: u6 = 0,
72717271
ADDRCONFIG: bool = false,
7272-
_: u21 = 0,
7272+
SRV: bool = false,
7273+
_: u20 = 0,
72737274
},
72747275
.illumos => packed struct(u32) {
72757276
V4MAPPED: bool = false,
@@ -7285,9 +7286,9 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
72857286
PASSIVE: bool = false,
72867287
CANONNAME: bool = false,
72877288
NUMERICHOST: bool = false,
7288-
_3: u1 = 0,
7289+
EXT: bool = false,
72897290
NUMERICSERV: bool = false,
7290-
_5: u1 = 0,
7291+
FQDN: bool = false,
72917292
ADDRCONFIG: bool = false,
72927293
_: u25 = 0,
72937294
},
@@ -7348,6 +7349,43 @@ pub const NI = switch (native_os) {
73487349
DGRAM: bool = false,
73497350
_: std.meta.Int(.unsigned, @bitSizeOf(c_int) - 5) = 0,
73507351
},
7352+
.freebsd, .haiku => packed struct(u32) {
7353+
NOFQDN: bool = false,
7354+
NUMERICHOST: bool = false,
7355+
NAMEREQD: bool = false,
7356+
NUMERICSERV: bool = false,
7357+
DGRAM: bool = false,
7358+
NUMERICSCOPE: bool = false,
7359+
_: u26 = 0,
7360+
},
7361+
.dragonfly, .netbsd => packed struct(u32) {
7362+
NOFQDN: bool = false,
7363+
NUMERICHOST: bool = false,
7364+
NAMEREQD: bool = false,
7365+
NUMERICSERV: bool = false,
7366+
DGRAM: bool = false,
7367+
_5: u1 = 0,
7368+
NUMERICSCOPE: bool = false,
7369+
_: u25 = 0,
7370+
},
7371+
.openbsd => packed struct(u32) {
7372+
NUMERICHOST: bool = false,
7373+
NUMERICSERV: bool = false,
7374+
NOFQDN: bool = false,
7375+
NAMEREQD: bool = false,
7376+
DGRAM: bool = false,
7377+
_: u27 = 0,
7378+
},
7379+
.driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
7380+
NOFQDN: bool = false,
7381+
NUMERICHOST: bool = false,
7382+
NAMEREQD: bool = false,
7383+
NUMERICSERV: bool = false,
7384+
DGRAM: bool = false,
7385+
_5: u3 = 0,
7386+
NUMERICSCOPE: bool = false,
7387+
_: u23 = 0,
7388+
},
73517389
else => void,
73527390
};
73537391

0 commit comments

Comments
 (0)