heimdal:lib/asn1: try to fix the build on IRIX

cc-1028 cc: ERROR File = ../source4/heimdal/lib/asn1/gen_template.c, Line = 548
  The expression used must have a constant value.

  struct templatehead template = { 0L, &(template). tqh_first };
                                         ^
If this really fixes the IRIX build, we'll propose this for heimdal upstream.

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Stefan Metzmacher
2012-06-10 16:21:12 +02:00
committed by Love Hornquist Astrand
parent 671c91fd5f
commit d28613ce11

View File

@@ -549,13 +549,15 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
case TNull: case TNull:
break; break;
case TBitString: { case TBitString: {
struct templatehead template = ASN1_TAILQ_HEAD_INITIALIZER(template); struct templatehead template;
struct template *q; struct template *q;
Member *m; Member *m;
size_t count = 0, i; size_t count = 0, i;
char *bname = NULL; char *bname = NULL;
FILE *f = get_code_file(); FILE *f = get_code_file();
ASN1_TAILQ_INIT(&template);
if (ASN1_TAILQ_EMPTY(t->members)) { if (ASN1_TAILQ_EMPTY(t->members)) {
add_line(temp, "{ A1_PARSE_T(A1T_HEIM_BIT_STRING), %s, NULL }", poffset); add_line(temp, "{ A1_PARSE_T(A1T_HEIM_BIT_STRING), %s, NULL }", poffset);
break; break;
@@ -685,7 +687,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
break; break;
} }
case TChoice: { case TChoice: {
struct templatehead template = ASN1_TAILQ_HEAD_INITIALIZER(template); struct templatehead template;
struct template *q; struct template *q;
size_t count = 0, i; size_t count = 0, i;
char *tname = NULL; char *tname = NULL;
@@ -694,6 +696,8 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
int ellipsis = 0; int ellipsis = 0;
char *e; char *e;
ASN1_TAILQ_INIT(&template);
if (asprintf(&tname, "asn1_choice_%s_%s%x", if (asprintf(&tname, "asn1_choice_%s_%s%x",
basetype, name ? name : "", (unsigned int)(uintptr_t)t) < 0 || tname == NULL) basetype, name ? name : "", (unsigned int)(uintptr_t)t) < 0 || tname == NULL)
errx(1, "malloc"); errx(1, "malloc");