asn1: don't include decoration header for void *

If the decorated external type is a void *, don't include the decoration
header in the ASN.1 header, only in the template implementation. This allows
the copy constructor and destructor to be implementation private.
This commit is contained in:
Luke Howard
2022-01-08 17:13:56 +11:00
committed by Nicolas Williams
parent df3e08485b
commit ef906991fd
2 changed files with 3 additions and 0 deletions

View File

@@ -1641,6 +1641,7 @@ declare_type(const Symbol *s, Type *t, int typedefp)
getnewbasename(&newbasename, TRUE, s->gen_name, s->gen_name);
fprintf(headerfile, "struct %s %s;\n", newbasename, s->gen_name);
if (decorate_type(newbasename, &deco) && deco.header_name
&& !deco.void_star
&& deco.header_name[0]) {
fprintf(headerfile, "#include %s\n", deco.header_name);
free(deco.field_type);

View File

@@ -1528,6 +1528,8 @@ generate_template(const Symbol *s)
}
if (decorate_type(s->gen_name, &deco) && deco.ext) {
if (deco.void_star && deco.header_name[0])
fprintf(f, "#include %s\n", deco.header_name);
fprintf(f,
"static const struct asn1_type_func asn1_extern_%s_%s = {\n"
"\t(asn1_type_encode)0,\n"