X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type.c;h=204d6f0129bc9333c3091d5479d59af6f928f255;hb=02f47f268839c472e23095ac0025e5ccbb5ed70a;hp=ce14faaf3a983fc69e2bf0e5672fb7e599efafb9;hpb=55b16fa3763521f0c279a0fc5ad01338a974aea3;p=cparser diff --git a/type.c b/type.c index ce14faa..204d6f0 100644 --- a/type.c +++ b/type.c @@ -295,14 +295,21 @@ void print_imaginary_type(const imaginary_type_t *type) */ static void print_function_type_pre(const function_type_t *type, bool top) { + if (type->linkage != NULL) { + fputs("extern \"", out); + fputs(type->linkage->string, out); + fputs("\" ", out); + } + print_type_qualifiers(type->base.qualifiers); if (type->base.qualifiers != 0) fputc(' ', out); - intern_print_type_pre(type->return_type, false); - switch (type->calling_convention) { +#if 0 + /* TODO: revive with linkage */ + switch (type->linkage) { case CC_CDECL: fputs("__cdecl ", out); break; @@ -318,6 +325,7 @@ static void print_function_type_pre(const function_type_t *type, bool top) case CC_DEFAULT: break; } +#endif /* don't emit parenthesis if we're the toplevel type... */ if (!top) @@ -1029,7 +1037,7 @@ static bool function_types_compatible(const function_type_t *func1, if (!types_compatible(ret1, ret2)) return false; - if (func1->calling_convention != func2->calling_convention) + if (func1->linkage != func2->linkage) return false; /* can parameters be compared? */