aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2022-10-05 21:51:37 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2022-10-25 05:11:28 -0400
commit72e2fc4c73b095eebe790047890c6283db501732 (patch)
tree1627486f5d8bb3dcf25bc55210be73f9328d6f5f /src
parent0092f6ed88f02a7930d9c27732a888c2e6c5e2dc (diff)
downloadzig-72e2fc4c73b095eebe790047890c6283db501732.tar.gz
zig-72e2fc4c73b095eebe790047890c6283db501732.zip
c: fix stage1 compatibility
Diffstat (limited to 'src')
-rw-r--r--src/codegen/c.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 2684ebf341..645bc7074f 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -492,11 +492,11 @@ pub const DeclGen = struct {
const index = field_ptr.field_index;
const FieldInfo = struct { name: []const u8, ty: Type };
const field_info: FieldInfo = switch (container_ty.zigTypeTag()) {
- .Struct => .{
+ .Struct => FieldInfo{
.name = container_ty.structFields().keys()[index],
.ty = container_ty.structFields().values()[index].ty,
},
- .Union => .{
+ .Union => FieldInfo{
.name = container_ty.unionFields().keys()[index],
.ty = container_ty.unionFields().values()[index].ty,
},
@@ -1622,7 +1622,12 @@ pub const DeclGen = struct {
const int_info = ty.intInfo(target);
_ = toCIntBits(int_info.bits) orelse
return dg.fail("TODO implement integer constants larger than 128 bits", .{});
- return .{ .ty = ty, .target = target, .int_val = int_val, .location = location };
+ return IntLiteralFormatter(@TypeOf(int_val)){
+ .ty = ty,
+ .target = target,
+ .int_val = int_val,
+ .location = location,
+ };
}
};