Skip to content

Commit

Permalink
Zig workaround: don't use packed structs larger than 128 bits.
Browse files Browse the repository at this point in the history
The C backend currently can't handle them
  • Loading branch information
ehaas committed Nov 1, 2023
1 parent 68095d5 commit 3591984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Diagnostics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ pub const Tag = std.meta.DeclEnum(messages);
// u4 to avoid any possible packed struct issues
pub const Kind = enum(u4) { @"fatal error", @"error", note, warning, off, default };

pub const Options = packed struct {
/// TODO: make this `packed struct` once the C backend can handle packed structs larger than 128 bits
pub const Options = struct {
// do not directly use these, instead add `const NAME = true;`
all: Kind = .default,
extra: Kind = .default,
Expand Down
2 changes: 1 addition & 1 deletion src/object/Elf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Symbol = struct {
info: u8,
};

const Relocation = packed struct {
const Relocation = struct {
symbol: *Symbol,
addend: i64,
offset: u48,
Expand Down

0 comments on commit 3591984

Please sign in to comment.