Skip to content

Commit

Permalink
haiku: debitrot
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Mar 23, 2024
1 parent c011abc commit 2dd74cd
Show file tree
Hide file tree
Showing 17 changed files with 392 additions and 88 deletions.
2 changes: 2 additions & 0 deletions bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 64,8 @@ static const char *get_host_os(void) {
return "linux";
#elif defined(__FreeBSD__)
return "freebsd";
#elif defined(__HAIKU__)
return "haiku";
#else
panic("unknown host os, specify with ZIG_HOST_TARGET_OS");
#endif
Expand Down
4 changes: 2 additions & 2 deletions lib/std/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1687,8 1687,8 @@ pub extern "c" fn getpeername(sockfd: c.fd_t, noalias addr: *c.sockaddr, noalias
pub extern "c" fn connect(sockfd: c.fd_t, sock_addr: *const c.sockaddr, addrlen: c.socklen_t) c_int;
pub extern "c" fn accept(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t) c_int;
pub extern "c" fn accept4(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t, flags: c_uint) c_int;
pub extern "c" fn getsockopt(sockfd: c.fd_t, level: u32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *c.socklen_t) c_int;
pub extern "c" fn setsockopt(sockfd: c.fd_t, level: u32, optname: u32, optval: ?*const anyopaque, optlen: c.socklen_t) c_int;
pub extern "c" fn getsockopt(sockfd: c.fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *c.socklen_t) c_int;
pub extern "c" fn setsockopt(sockfd: c.fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: c.socklen_t) c_int;
pub extern "c" fn send(sockfd: c.fd_t, buf: *const anyopaque, len: usize, flags: u32) isize;
pub extern "c" fn sendto(
sockfd: c.fd_t,
Expand Down
4 changes: 2 additions & 2 deletions lib/std/c/darwin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 1139,7 @@ pub const siginfo_t = extern struct {
pid: pid_t,
uid: uid_t,
status: c_int,
addr: *anyopaque,
addr: *allowzero anyopaque,
value: extern union {
int: c_int,
ptr: *anyopaque,
Expand All @@ -1151,7 1151,7 @@ pub const siginfo_t = extern struct {
/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
pub const Sigaction = extern struct {
pub const handler_fn = *align(1) const fn (c_int) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*anyopaque) callconv(.C) void;

handler: extern union {
handler: ?handler_fn,
Expand Down
4 changes: 2 additions & 2 deletions lib/std/c/dragonfly.zig
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 668,7 @@ pub const siginfo_t = extern struct {
pid: c_int,
uid: uid_t,
status: c_int,
addr: ?*anyopaque,
addr: *allowzero anyopaque,
value: sigval,
band: c_long,
__spare__: [7]c_int,
Expand All @@ -691,7 691,7 @@ pub const sig_atomic_t = c_int;

pub const Sigaction = extern struct {
pub const handler_fn = *align(1) const fn (c_int) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*anyopaque) callconv(.C) void;

/// signal handler
handler: extern union {
Expand Down
4 changes: 2 additions & 2 deletions lib/std/c/freebsd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 1172,7 @@ const NSIG = 32;
/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
pub const Sigaction = extern struct {
pub const handler_fn = *align(1) const fn (c_int) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*anyopaque) callconv(.C) void;

/// signal handler
handler: extern union {
Expand Down Expand Up @@ -1206,7 1206,7 @@ pub const siginfo_t = extern struct {
/// Exit value.
status: c_int,
/// Faulting instruction.
addr: ?*anyopaque,
addr: *allowzero anyopaque,
/// Signal value.
value: sigval,
reason: extern union {
Expand Down
Loading

0 comments on commit 2dd74cd

Please sign in to comment.