switch the units variable to a function. gcc-4.1 needs the size of the
structure if its defined as extern struct units foo_units[] an we don't want to include <parse_units.h> in the generate headerfile git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14959 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -103,11 +103,11 @@ generate_units (const Symbol *s)
|
|||||||
int tag = -1;
|
int tag = -1;
|
||||||
|
|
||||||
fprintf (headerfile,
|
fprintf (headerfile,
|
||||||
"extern struct units %s_units[];",
|
"const struct units * asn1_%s_units(void);",
|
||||||
s->gen_name);
|
s->gen_name);
|
||||||
|
|
||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"struct units %s_units[] = {\n",
|
"static struct units %s_units[] = {\n",
|
||||||
s->gen_name);
|
s->gen_name);
|
||||||
|
|
||||||
if(t->members)
|
if(t->members)
|
||||||
@@ -122,6 +122,14 @@ generate_units (const Symbol *s)
|
|||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"\t{NULL,\t0}\n"
|
"\t{NULL,\t0}\n"
|
||||||
"};\n\n");
|
"};\n\n");
|
||||||
|
|
||||||
|
fprintf (codefile,
|
||||||
|
"const struct units * asn1_%s_units(void){\n"
|
||||||
|
"return %s_units;\n"
|
||||||
|
"}\n\n",
|
||||||
|
s->gen_name, s->gen_name);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user