From 98dcb8409a45d80fcd3f54ee25489cdddc12d4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 25 Apr 2005 18:07:07 +0000 Subject: [PATCH] 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 in the generate headerfile git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14959 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/gen_glue.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/asn1/gen_glue.c b/lib/asn1/gen_glue.c index 356b7e948..b4e98e07f 100644 --- a/lib/asn1/gen_glue.c +++ b/lib/asn1/gen_glue.c @@ -103,11 +103,11 @@ generate_units (const Symbol *s) int tag = -1; fprintf (headerfile, - "extern struct units %s_units[];", + "const struct units * asn1_%s_units(void);", s->gen_name); fprintf (codefile, - "struct units %s_units[] = {\n", + "static struct units %s_units[] = {\n", s->gen_name); if(t->members) @@ -122,6 +122,14 @@ generate_units (const Symbol *s) fprintf (codefile, "\t{NULL,\t0}\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