c variadic calls
This commit is contained in:
@@ -46,10 +46,11 @@ Alias :: struct {
|
||||
}
|
||||
|
||||
Function :: struct {
|
||||
name: string,
|
||||
params: []Type_Id,
|
||||
result: Type_Id,
|
||||
reason: string,
|
||||
name: string,
|
||||
params: []Type_Id,
|
||||
result: Type_Id,
|
||||
variadic: bool,
|
||||
reason: string,
|
||||
}
|
||||
|
||||
Unsupported :: struct {
|
||||
|
||||
@@ -338,9 +338,8 @@ visit_cursor :: proc "c"(cursor, parent: CXCursor, client_data: rawptr) -> i32 {
|
||||
linkage := ctx.api.get_cursor_linkage(cursor)
|
||||
if linkage != CXLinkage_External {
|
||||
reason = "static and non-external C functions are not supported"
|
||||
} else if ctx.api.cursor_is_variadic(cursor) != 0 {
|
||||
reason = "C variadic functions are not supported"
|
||||
}
|
||||
variadic := ctx.api.cursor_is_variadic(cursor) != 0
|
||||
function_type := ctx.api.get_cursor_type(cursor)
|
||||
result_type := translate_type(ctx, ctx.api.get_result_type(function_type))
|
||||
if result_type == INVALID_TYPE && len(reason) == 0 {
|
||||
@@ -364,6 +363,7 @@ visit_cursor :: proc "c"(cursor, parent: CXCursor, client_data: rawptr) -> i32 {
|
||||
name=fmt.aprintf("%s", name, allocator=ctx.allocator),
|
||||
params=params[:],
|
||||
result=result_type,
|
||||
variadic=variadic,
|
||||
reason=fmt.aprintf("%s", reason, allocator=ctx.allocator),
|
||||
})
|
||||
case CXCursor_TypedefDecl:
|
||||
|
||||
Reference in New Issue
Block a user