2019-12-02 20:02:17 +00:00
|
|
|
//! Platform-dependent types and values that are used along with OS-specific APIs.
|
|
|
|
//! These are imported into `std.c`, `std.os`, and `std.os.linux`.
|
|
|
|
//! Root source files can define `os.bits` and these will additionally be added
|
|
|
|
//! to the namespace.
|
2019-05-25 00:36:09 +01:00
|
|
|
|
2020-02-25 06:52:27 +00:00
|
|
|
const std = @import("std");
|
2019-12-02 20:02:17 +00:00
|
|
|
const root = @import("root");
|
2019-05-25 00:36:09 +01:00
|
|
|
|
2020-02-25 06:52:27 +00:00
|
|
|
pub usingnamespace switch (std.Target.current.os.tag) {
|
2019-05-25 00:36:09 +01:00
|
|
|
.macosx, .ios, .tvos, .watchos => @import("bits/darwin.zig"),
|
2019-10-22 23:06:35 +01:00
|
|
|
.dragonfly => @import("bits/dragonfly.zig"),
|
2019-05-25 00:36:09 +01:00
|
|
|
.freebsd => @import("bits/freebsd.zig"),
|
|
|
|
.linux => @import("bits/linux.zig"),
|
|
|
|
.netbsd => @import("bits/netbsd.zig"),
|
|
|
|
.wasi => @import("bits/wasi.zig"),
|
|
|
|
.windows => @import("bits/windows.zig"),
|
|
|
|
else => struct {},
|
|
|
|
};
|
|
|
|
|
2019-12-02 20:02:17 +00:00
|
|
|
pub usingnamespace if (@hasDecl(root, "os") and @hasDecl(root.os, "bits")) root.os.bits else struct {};
|
|
|
|
|
2019-05-25 00:36:09 +01:00
|
|
|
pub const iovec = extern struct {
|
|
|
|
iov_base: [*]u8,
|
|
|
|
iov_len: usize,
|
|
|
|
};
|
|
|
|
|
|
|
|
pub const iovec_const = extern struct {
|
|
|
|
iov_base: [*]const u8,
|
|
|
|
iov_len: usize,
|
|
|
|
};
|