mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix C error with clang, when declaring a fn type with an alias type argument (#10297)
This commit is contained in:
parent
148bb31f6e
commit
0afeba5588
@ -822,9 +822,6 @@ static inline void __${typ.cname}_pushval($typ.cname ch, $el_stype val) {
|
|||||||
.map {
|
.map {
|
||||||
g.type_definitions.writeln('typedef map $typ.cname;')
|
g.type_definitions.writeln('typedef map $typ.cname;')
|
||||||
}
|
}
|
||||||
.function {
|
|
||||||
g.write_fn_typesymbol_declaration(typ)
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -835,6 +832,11 @@ static inline void __${typ.cname}_pushval($typ.cname ch, $el_stype val) {
|
|||||||
g.write_alias_typesymbol_declaration(typ)
|
g.write_alias_typesymbol_declaration(typ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for typ in g.table.type_symbols {
|
||||||
|
if typ.kind == .function && typ.name !in c.builtins {
|
||||||
|
g.write_fn_typesymbol_declaration(typ)
|
||||||
|
}
|
||||||
|
}
|
||||||
// Generating interfaces after all the common types have been defined
|
// Generating interfaces after all the common types have been defined
|
||||||
// to prevent generating interface struct before definition of field types
|
// to prevent generating interface struct before definition of field types
|
||||||
for typ in g.table.type_symbols {
|
for typ in g.table.type_symbols {
|
||||||
|
@ -44,6 +44,9 @@ type F6 = fn (int, int)
|
|||||||
|
|
||||||
type F7 = fn (time.Time, int)
|
type F7 = fn (time.Time, int)
|
||||||
|
|
||||||
|
type MyTime = time.Time
|
||||||
|
type F8 = fn (MyTime)
|
||||||
|
|
||||||
fn C.atoi(&byte) int
|
fn C.atoi(&byte) int
|
||||||
fn C.freec(ptr voidptr)
|
fn C.freec(ptr voidptr)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user