mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
openbsd: make dl_phdr_info cross arches
introduce Addr and Half definition to std.elf, and use them for dl_phdr_info
This commit is contained in:
parent
0088efc4b2
commit
2a0a11aa66
@ -937,6 +937,16 @@ pub const Verdaux = switch (@sizeOf(usize)) {
|
||||
8 => Elf64_Verdaux,
|
||||
else => @compileError("expected pointer size of 32 or 64"),
|
||||
};
|
||||
pub const Addr = switch (@sizeOf(usize)) {
|
||||
4 => Elf32_Addr,
|
||||
8 => Elf64_Addr,
|
||||
else => @compileError("expected pointer size of 32 or 64"),
|
||||
};
|
||||
pub const Half = switch (@sizeOf(usize)) {
|
||||
4 => Elf32_Half,
|
||||
8 => Elf64_Half,
|
||||
else => @compileError("expected pointer size of 32 or 64"),
|
||||
};
|
||||
|
||||
/// Machine architectures
|
||||
/// See current registered ELF machine architectures at:
|
||||
|
||||
@ -33,10 +33,10 @@ pub const Kevent = extern struct {
|
||||
};
|
||||
|
||||
pub const dl_phdr_info = extern struct {
|
||||
dlpi_addr: usize,
|
||||
dlpi_addr: std.elf.Addr,
|
||||
dlpi_name: ?[*:0]const u8,
|
||||
dlpi_phdr: [*]std.elf.Phdr,
|
||||
dlpi_phnum: u16,
|
||||
dlpi_phnum: std.elf.Half,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user