-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.zig
More file actions
36 lines (32 loc) · 839 Bytes
/
debug.zig
File metadata and controls
36 lines (32 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const builtin = @import("builtin");
const std = @import("std.zig");
const root = @import("root");
const math = std.math;
const mem = std.mem;
const io = std.io;
const posix = std.posix;
const fs = std.fs;
const testing = std.testing;
const os = std.os;
const File = fs.File;
const win = os.windows;
const native = .{
.arch = builtin.cpu.arch,
.os = builtin.os.tag,
.endian = builtin.cpu.arch.endian()
};
pub fn fullPanic(comptime panicFn:fn([]const u8, ?usize) noreturn) type {
return struct {
pub const call = panicFn;
pub fn sentinelMismatch(expected:anytype, found:@TypeOf(expected)) noreturn {
@branchHint(.cold);
}
};
}
// pub fn panicExtra(retAddr:?usize, comptime f:[]const u8, args:anytype) noreturn {
// @branchHint(.cold);
// const
// }
pub fn assert(ok:bool) void {
if (!ok) unreachable;
}