From 23f553ffd5fb14081c82220e0630e2436053f679 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 17 Dec 2020 11:58:22 -0600 Subject: [PATCH] asn1: Generate 1/0 instead of TRUE/FALSE TRUE/FALSE may not be defined, so emitting those symbols when generating code for `... BOOLEAN DEFAULT TRUE -- or FALSE` causes the generated code to fail to compile. We could move the definitions of TRUE/FALSE to krb5-types.h, or maybe we could have an asn1_compile option to force inclusion of more than one header file so we can have headers defining such constants. But the simplest fix is to just emit 1/0 instead of TRUE/FALSE. This explains why some BOOLEAN DEFAULT usages in PKIX are made OPTIONAL in Heimdal. --- lib/asn1/gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asn1/gen.c b/lib/asn1/gen.c index 38bf9aad5..1df8b720d 100644 --- a/lib/asn1/gen.c +++ b/lib/asn1/gen.c @@ -324,9 +324,9 @@ gen_assign_defval(const char *var, struct value *val) break; case booleanvalue: if(val->u.booleanvalue) - fprintf(codefile, "%s = TRUE;\n", var); + fprintf(codefile, "%s = 1;\n", var); else - fprintf(codefile, "%s = FALSE;\n", var); + fprintf(codefile, "%s = 0;\n", var); break; default: abort();