mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.debug: select SelfInfo using ObjectFormat.default()
This commit is contained in:
parent
2cdafe9106
commit
59633e54a2
@ -61,28 +61,12 @@ pub const cpu_context = @import("debug/cpu_context.zig");
|
||||
/// ```
|
||||
pub const SelfInfo = if (@hasDecl(root, "debug") and @hasDecl(root.debug, "SelfInfo"))
|
||||
root.debug.SelfInfo
|
||||
else switch (native_os) {
|
||||
.linux,
|
||||
.netbsd,
|
||||
.freebsd,
|
||||
.dragonfly,
|
||||
.openbsd,
|
||||
.solaris,
|
||||
.illumos,
|
||||
=> @import("debug/SelfInfo/Elf.zig"),
|
||||
|
||||
.macos,
|
||||
.ios,
|
||||
.watchos,
|
||||
.tvos,
|
||||
.visionos,
|
||||
=> @import("debug/SelfInfo/Darwin.zig"),
|
||||
|
||||
.uefi,
|
||||
.windows,
|
||||
=> @import("debug/SelfInfo/Windows.zig"),
|
||||
|
||||
else => void,
|
||||
else switch (std.Target.ObjectFormat.default(native_os, native_arch)) {
|
||||
.coff => @import("debug/SelfInfo/Windows.zig"),
|
||||
.elf => @import("debug/SelfInfo/Elf.zig"),
|
||||
.macho => @import("debug/SelfInfo/Darwin.zig"),
|
||||
.goff, .plan9, .spirv, .wasm, .xcoff => void,
|
||||
.c, .hex, .raw => unreachable,
|
||||
};
|
||||
|
||||
pub const SelfInfoError = error{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user