| author | |
| committer | |
| log | b55efe5fabc5e743406d62bf5b1c2ebfcc8fc5b0 |
| tree | 2786bbab71399b3ed6d581e721cfdc7aee9653a8 |
| parent | 43be6ccb03e6ce32f78c69129b61d49cae2b747d |
9 files changed, 34 insertions(+), 34 deletions(-)
std/darwin.zig+3-3| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | ||
| 2 | const arch = switch (@compileVar("arch")) { | 2 | const arch = switch (@compileVar("arch")) { |
| 3 | x86_64 => @import("darwin_x86_64.zig"), | 3 | Arch.x86_64 => @import("darwin_x86_64.zig"), |
| 4 | else => @compile_err("unsupported arch"), | 4 | else => @compileError("unsupported arch"), |
| 5 | }; | 5 | }; |
| 6 | 6 | ||
| 7 | const errno = @import("errno.zig"); | 7 | const errno = @import("errno.zig"); |
| ... | @@ -88,7 +88,7 @@ pub fn fstat(fd: i32, stat_buf: &stat) -> usize { | ... | @@ -88,7 +88,7 @@ pub fn fstat(fd: i32, stat_buf: &stat) -> usize { |
| 88 | arch.syscall2(arch.SYS_fstat, usize(fd), usize(stat_buf)) | 88 | arch.syscall2(arch.SYS_fstat, usize(fd), usize(stat_buf)) |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | pub error Unexpected; | 91 | error Unexpected; |
| 92 | 92 | ||
| 93 | pub fn getrandom(buf: &u8, count: usize) -> usize { | 93 | pub fn getrandom(buf: &u8, count: usize) -> usize { |
| 94 | const rr = open_c(c"/dev/urandom", O_LARGEFILE | O_RDONLY, 0); | 94 | const rr = open_c(c"/dev/urandom", O_LARGEFILE | O_RDONLY, 0); |
std/darwin_x86_64.zig+4-4| ... | @@ -57,7 +57,7 @@ pub inline fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) -> | ... | @@ -57,7 +57,7 @@ pub inline fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) -> |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | export struct stat { | 60 | pub const stat = extern struct { |
| 61 | dev: u32, | 61 | dev: u32, |
| 62 | mode: u16, | 62 | mode: u16, |
| 63 | nlink: u16, | 63 | nlink: u16, |
| ... | @@ -78,9 +78,9 @@ export struct stat { | ... | @@ -78,9 +78,9 @@ export struct stat { |
| 78 | lspare: i32, | 78 | lspare: i32, |
| 79 | qspare: [2]u64, | 79 | qspare: [2]u64, |
| 80 | 80 | ||
| 81 | } | 81 | }; |
| 82 | 82 | ||
| 83 | export struct timespec { | 83 | pub const timespec = extern struct { |
| 84 | tv_sec: isize, | 84 | tv_sec: isize, |
| 85 | tv_nsec: isize, | 85 | tv_nsec: isize, |
| 86 | } | 86 | }; |
std/debug.zig+7-7| ... | @@ -5,9 +5,9 @@ const elf = @import("elf.zig"); | ... | @@ -5,9 +5,9 @@ const elf = @import("elf.zig"); |
| 5 | const DW = @import("dwarf.zig"); | 5 | const DW = @import("dwarf.zig"); |
| 6 | const List = @import("list.zig").List; | 6 | const List = @import("list.zig").List; |
| 7 | 7 | ||
| 8 | pub error MissingDebugInfo; | 8 | error MissingDebugInfo; |
| 9 | pub error InvalidDebugInfo; | 9 | error InvalidDebugInfo; |
| 10 | pub error UnsupportedDebugInfo; | 10 | error UnsupportedDebugInfo; |
| 11 | 11 | ||
| 12 | pub fn assert(b: bool) { | 12 | pub fn assert(b: bool) { |
| 13 | if (!b) @unreachable() | 13 | if (!b) @unreachable() |
| ... | @@ -20,7 +20,7 @@ pub fn printStackTrace() -> %void { | ... | @@ -20,7 +20,7 @@ pub fn printStackTrace() -> %void { |
| 20 | 20 | ||
| 21 | pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { | 21 | pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { |
| 22 | switch (@compileVar("object_format")) { | 22 | switch (@compileVar("object_format")) { |
| 23 | elf => { | 23 | ObjectFormat.elf => { |
| 24 | var stack_trace = ElfStackTrace { | 24 | var stack_trace = ElfStackTrace { |
| 25 | .self_exe_stream = undefined, | 25 | .self_exe_stream = undefined, |
| 26 | .elf = undefined, | 26 | .elf = undefined, |
| ... | @@ -57,13 +57,13 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { | ... | @@ -57,13 +57,13 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { |
| 57 | maybe_fp = *(&const ?&const u8)(fp); | 57 | maybe_fp = *(&const ?&const u8)(fp); |
| 58 | } | 58 | } |
| 59 | }, | 59 | }, |
| 60 | coff => { | 60 | ObjectFormat.coff => { |
| 61 | out_stream.write("(stack trace unavailable for COFF object format)\n"); | 61 | out_stream.write("(stack trace unavailable for COFF object format)\n"); |
| 62 | }, | 62 | }, |
| 63 | macho => { | 63 | ObjectFormat.macho => { |
| 64 | %return out_stream.write("(stack trace unavailable for Mach-O object format)\n"); | 64 | %return out_stream.write("(stack trace unavailable for Mach-O object format)\n"); |
| 65 | }, | 65 | }, |
| 66 | unknown => { | 66 | ObjectFormat.unknown => { |
| 67 | out_stream.write("(stack trace unavailable for unknown object format)\n"); | 67 | out_stream.write("(stack trace unavailable for unknown object format)\n"); |
| 68 | }, | 68 | }, |
| 69 | } | 69 | } |
std/elf.zig+1-1| ... | @@ -4,7 +4,7 @@ const math = @import("math.zig"); | ... | @@ -4,7 +4,7 @@ const math = @import("math.zig"); |
| 4 | const mem = @import("mem.zig"); | 4 | const mem = @import("mem.zig"); |
| 5 | const debug = @import("debug.zig"); | 5 | const debug = @import("debug.zig"); |
| 6 | 6 | ||
| 7 | pub error InvalidFormat; | 7 | error InvalidFormat; |
| 8 | 8 | ||
| 9 | pub const SHT_NULL = 0; | 9 | pub const SHT_NULL = 0; |
| 10 | pub const SHT_PROGBITS = 1; | 10 | pub const SHT_PROGBITS = 1; |
std/index.zig+2-2| ... | @@ -10,11 +10,11 @@ pub const hash_map = @import("hash_map.zig"); | ... | @@ -10,11 +10,11 @@ pub const hash_map = @import("hash_map.zig"); |
| 10 | pub const mem = @import("mem.zig"); | 10 | pub const mem = @import("mem.zig"); |
| 11 | pub const debug = @import("debug.zig"); | 11 | pub const debug = @import("debug.zig"); |
| 12 | pub const linux = switch(@compileVar("os")) { | 12 | pub const linux = switch(@compileVar("os")) { |
| 13 | linux => @import("linux.zig"), | 13 | Os.linux => @import("linux.zig"), |
| 14 | else => null_import, | 14 | else => null_import, |
| 15 | }; | 15 | }; |
| 16 | pub const darwin = switch(@compileVar("os")) { | 16 | pub const darwin = switch(@compileVar("os")) { |
| 17 | darwin => @import("darwin.zig"), | 17 | Os.darwin => @import("darwin.zig"), |
| 18 | else => null_import, | 18 | else => null_import, |
| 19 | }; | 19 | }; |
| 20 | const null_import = @import("empty.zig"); | 20 | const null_import = @import("empty.zig"); |
std/linux.zig+3-3| ... | @@ -456,9 +456,9 @@ pub fn accept4(fd: i32, noalias addr: &sockaddr, noalias len: &socklen_t, flags: | ... | @@ -456,9 +456,9 @@ pub fn accept4(fd: i32, noalias addr: &sockaddr, noalias len: &socklen_t, flags: |
| 456 | arch.syscall4(arch.SYS_accept4, usize(fd), usize(addr), usize(len), flags) | 456 | arch.syscall4(arch.SYS_accept4, usize(fd), usize(addr), usize(len), flags) |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | // pub error NameTooLong; | 459 | // error NameTooLong; |
| 460 | // pub error SystemResources; | 460 | // error SystemResources; |
| 461 | // pub error Io; | 461 | // error Io; |
| 462 | // | 462 | // |
| 463 | // pub fn if_nametoindex(name: []u8) -> %u32 { | 463 | // pub fn if_nametoindex(name: []u8) -> %u32 { |
| 464 | // var ifr: ifreq = undefined; | 464 | // var ifr: ifreq = undefined; |
std/mem.zig+1-1| ... | @@ -5,7 +5,7 @@ const io = @import("io.zig"); | ... | @@ -5,7 +5,7 @@ const io = @import("io.zig"); |
| 5 | 5 | ||
| 6 | pub const Cmp = math.Cmp; | 6 | pub const Cmp = math.Cmp; |
| 7 | 7 | ||
| 8 | pub error NoMem; | 8 | error NoMem; |
| 9 | 9 | ||
| 10 | pub type Context = u8; | 10 | pub type Context = u8; |
| 11 | pub const Allocator = struct { | 11 | pub const Allocator = struct { |
std/net.zig+10-10| ... | @@ -3,15 +3,15 @@ const errno = @import("errno.zig"); | ... | @@ -3,15 +3,15 @@ const errno = @import("errno.zig"); |
| 3 | const assert = @import("debug.zig").assert; | 3 | const assert = @import("debug.zig").assert; |
| 4 | const endian = @import("endian.zig"); | 4 | const endian = @import("endian.zig"); |
| 5 | 5 | ||
| 6 | pub error SigInterrupt; | 6 | error SigInterrupt; |
| 7 | pub error Unexpected; | 7 | error Unexpected; |
| 8 | pub error Io; | 8 | error Io; |
| 9 | pub error TimedOut; | 9 | error TimedOut; |
| 10 | pub error ConnectionReset; | 10 | error ConnectionReset; |
| 11 | pub error ConnectionRefused; | 11 | error ConnectionRefused; |
| 12 | pub error NoMem; | 12 | error NoMem; |
| 13 | pub error NotSocket; | 13 | error NotSocket; |
| 14 | pub error BadFd; | 14 | error BadFd; |
| 15 | 15 | ||
| 16 | const Connection = struct { | 16 | const Connection = struct { |
| 17 | socket_fd: i32, | 17 | socket_fd: i32, |
| ... | @@ -139,7 +139,7 @@ pub fn connect(hostname: []const u8, port: u16) -> %Connection { | ... | @@ -139,7 +139,7 @@ pub fn connect(hostname: []const u8, port: u16) -> %Connection { |
| 139 | return connectAddr(main_addr, port); | 139 | return connectAddr(main_addr, port); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | pub error InvalidIpLiteral; | 142 | error InvalidIpLiteral; |
| 143 | 143 | ||
| 144 | pub fn parseIpLiteral(buf: []const u8) -> %Address { | 144 | pub fn parseIpLiteral(buf: []const u8) -> %Address { |
| 145 | switch (parseIp4(buf)) { | 145 | switch (parseIp4(buf)) { |
std/os.zig+3-3| ... | @@ -1,11 +1,11 @@ | ... | @@ -1,11 +1,11 @@ |
| 1 | const system = switch(@compileVar("os")) { | 1 | const system = switch(@compileVar("os")) { |
| 2 | linux => @import("linux.zig"), | 2 | Os.linux => @import("linux.zig"), |
| 3 | darwin => @import("darwin.zig"), | 3 | Os.darwin => @import("darwin.zig"), |
| 4 | else => @compileError("Unsupported OS"), | 4 | else => @compileError("Unsupported OS"), |
| 5 | }; | 5 | }; |
| 6 | const errno = @import("errno.zig"); | 6 | const errno = @import("errno.zig"); |
| 7 | 7 | ||
| 8 | pub error Unexpected; | 8 | error Unexpected; |
| 9 | 9 | ||
| 10 | pub fn getRandomBytes(buf: []u8) -> %void { | 10 | pub fn getRandomBytes(buf: []u8) -> %void { |
| 11 | while (true) { | 11 | while (true) { |