asn1: use roken for generated source files

roken ensures the correct headers are used for each platform,
ensures availability of non-portable constants (e.g. ENOTSUP),
and on Windows enforces a consistent source for memory management.

Change-Id: I31aa2935d0af9f3d9529166679d9eff35ccedfad
This commit is contained in:
Jeffrey Altman
2021-11-16 10:23:42 -05:00
committed by Jeffrey Altman
parent 26df35d5f0
commit e27e056b45

View File

@@ -177,9 +177,9 @@ init_generate (const char *filename, const char *base)
"#ifndef __%s_h__\n"
"#define __%s_h__\n\n", headerbase, headerbase);
fprintf (headerfile,
"#include <stddef.h>\n"
"#include <stdint.h>\n"
"#include <time.h>\n\n");
"#include <config.h>\n"
"#include <roken.h>\n"
"#include <stddef.h>\n");
fprintf (headerfile,
"#ifndef __asn1_common_definitions__\n"
"#define __asn1_common_definitions__\n\n");
@@ -307,12 +307,8 @@ init_generate (const char *filename, const char *base)
fprintf (templatefile,
"/* Generated from %s */\n"
"/* Do not edit */\n\n"
"#include <stdio.h>\n"
"#include <stdlib.h>\n"
"#include <time.h>\n"
"#include <string.h>\n"
"#include <errno.h>\n"
"#include <limits.h>\n"
"#include <config.h>\n"
"#include <roken.h>\n"
"#include <asn1_err.h>\n"
"#include <%s>\n",
filename,
@@ -411,12 +407,8 @@ generate_header_of_codefile(const char *name)
"/* Generated from %s */\n"
"/* Do not edit */\n\n"
"#define ASN1_LIB\n\n"
"#include <stdio.h>\n"
"#include <stdlib.h>\n"
"#include <time.h>\n"
"#include <string.h>\n"
"#include <errno.h>\n"
"#include <limits.h>\n"
"#include <config.h>\n"
"#include <roken.h>\n"
"#include <%s>\n",
orig_filename,
type_file_string);