mirror of
https://github.com/ziglang/zig.git
synced 2025-12-26 08:03:08 +00:00
Merge branch 'dimenus-parsec'
This commit is contained in:
commit
6356724057
@ -485,8 +485,13 @@ static void construct_linker_job_coff(LinkJob *lj) {
|
||||
continue;
|
||||
}
|
||||
if (link_lib->provided_explicitly) {
|
||||
Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name));
|
||||
lj->args.append(buf_ptr(arg));
|
||||
if (lj->codegen->zig_target.env_type == ZigLLVM_GNU) {
|
||||
Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name));
|
||||
lj->args.append(buf_ptr(arg));
|
||||
}
|
||||
else {
|
||||
lj->args.append(buf_ptr(link_lib->name));
|
||||
}
|
||||
} else {
|
||||
buf_resize(def_contents, 0);
|
||||
buf_appendf(def_contents, "LIBRARY %s\nEXPORTS\n", buf_ptr(link_lib->name));
|
||||
|
||||
@ -2577,11 +2577,10 @@ static AstNode *resolve_typdef_as_builtin(Context *c, const TypedefNameDecl *typ
|
||||
}
|
||||
|
||||
static AstNode *resolve_typedef_decl(Context *c, const TypedefNameDecl *typedef_decl) {
|
||||
auto existing_entry = c->decl_table.maybe_get((void*)typedef_decl);
|
||||
auto existing_entry = c->decl_table.maybe_get((void*)typedef_decl->getCanonicalDecl());
|
||||
if (existing_entry) {
|
||||
return existing_entry->value;
|
||||
}
|
||||
|
||||
QualType child_qt = typedef_decl->getUnderlyingType();
|
||||
Buf *type_name = buf_create_from_str(decl_name(typedef_decl));
|
||||
|
||||
@ -2624,7 +2623,7 @@ static AstNode *resolve_typedef_decl(Context *c, const TypedefNameDecl *typedef_
|
||||
add_global_var(c, type_name, type_node);
|
||||
|
||||
AstNode *symbol_node = trans_create_node_symbol(c, type_name);
|
||||
c->decl_table.put(typedef_decl, symbol_node);
|
||||
c->decl_table.put(typedef_decl->getCanonicalDecl(), symbol_node);
|
||||
return symbol_node;
|
||||
}
|
||||
|
||||
@ -2750,6 +2749,7 @@ static AstNode *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) {
|
||||
AstNode *symbol_node = trans_create_node_symbol(c, full_type_name);
|
||||
add_global_weak_alias(c, bare_name, full_type_name);
|
||||
add_global_var(c, full_type_name, enum_node);
|
||||
c->decl_table.put(enum_decl->getCanonicalDecl(), symbol_node);
|
||||
return symbol_node;
|
||||
}
|
||||
}
|
||||
|
||||
@ -619,6 +619,17 @@ pub fn addCases(cases: &tests.ParseCContext) {
|
||||
\\ };
|
||||
\\}
|
||||
);
|
||||
|
||||
cases.addC("duplicate typedef",
|
||||
\\typedef long foo;
|
||||
\\typedef int bar;
|
||||
\\typedef long foo;
|
||||
\\typedef int baz;
|
||||
,
|
||||
\\pub const foo = c_long;
|
||||
\\pub const bar = c_int;
|
||||
\\pub const baz = c_int;
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user