master
SuperAuguste 2020-04-07 14:39:24 -04:00
parent 9298d38cee
commit f21ac0220a
1 changed files with 1 additions and 4 deletions

View File

@ -811,13 +811,10 @@ fn transRecordDecl(c: *Context, record_decl: *const ZigClangRecordDecl) Error!?*
var is_anon = false;
var raw_name = try c.str(ZigClangNamedDecl_getName_bytes_begin(@ptrCast(*const ZigClangNamedDecl, field_decl)));
if (ZigClangFieldDecl_isAnonymousStructOrUnion(field_decl)) {
if (ZigClangFieldDecl_isAnonymousStructOrUnion(field_decl) or (std.Target.current.abi == .msvc and raw_name.len == 0)) {
raw_name = try std.fmt.allocPrint(c.a(), "unnamed_{}", .{c.getMangle()});
is_anon = true;
}
if (raw_name.len == 0) {
continue;
}
const field_name = try appendIdentifier(c, raw_name);
_ = try appendToken(c, .Colon, ":");
const field_type = transQualType(rp, field_qt, field_loc) catch |err| switch (err) {