generated files must #include config if supported
The source files generated by compile_et and asn1-compile must begin with: #ifdef HAVE_CONFIG_H #include <config.h> #endif This permits conditional includes based on HAVE_STDINT_H and HAVE_UNISTD_H to work. Change-Id: Iefe25317ac3cb1970793748b8318174bcd7a087f
This commit is contained in:
@@ -158,6 +158,9 @@ init_generate (const char *filename, const char *base)
|
|||||||
"#ifndef __%s_h__\n"
|
"#ifndef __%s_h__\n"
|
||||||
"#define __%s_h__\n\n", headerbase, headerbase);
|
"#define __%s_h__\n\n", headerbase, headerbase);
|
||||||
fprintf (headerfile,
|
fprintf (headerfile,
|
||||||
|
"#ifdef HAVE_CONFIG_H\n"
|
||||||
|
"#include <config.h>\n"
|
||||||
|
"#endif\n"
|
||||||
"#include <stddef.h>\n"
|
"#include <stddef.h>\n"
|
||||||
"#include <time.h>\n\n");
|
"#include <time.h>\n\n");
|
||||||
fprintf (headerfile,
|
fprintf (headerfile,
|
||||||
@@ -262,6 +265,9 @@ init_generate (const char *filename, const char *base)
|
|||||||
fprintf (templatefile,
|
fprintf (templatefile,
|
||||||
"/* Generated from %s */\n"
|
"/* Generated from %s */\n"
|
||||||
"/* Do not edit */\n\n"
|
"/* Do not edit */\n\n"
|
||||||
|
"#ifdef HAVE_CONFIG_H\n"
|
||||||
|
"#include <config.h>\n"
|
||||||
|
"#endif\n"
|
||||||
"#include <stdio.h>\n"
|
"#include <stdio.h>\n"
|
||||||
"#include <stdlib.h>\n"
|
"#include <stdlib.h>\n"
|
||||||
"#ifdef HAVE_STDINT_H\n"
|
"#ifdef HAVE_STDINT_H\n"
|
||||||
@@ -363,6 +369,9 @@ generate_header_of_codefile(const char *name)
|
|||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"/* Generated from %s */\n"
|
"/* Generated from %s */\n"
|
||||||
"/* Do not edit */\n\n"
|
"/* Do not edit */\n\n"
|
||||||
|
"#ifdef HAVE_CONFIG_H\n"
|
||||||
|
"#include <config.h>\n"
|
||||||
|
"#endif\n"
|
||||||
"#define ASN1_LIB\n\n"
|
"#define ASN1_LIB\n\n"
|
||||||
"#include <stdio.h>\n"
|
"#include <stdio.h>\n"
|
||||||
"#include <stdlib.h>\n"
|
"#include <stdlib.h>\n"
|
||||||
|
@@ -79,6 +79,9 @@ generate_c(void)
|
|||||||
if(id_str)
|
if(id_str)
|
||||||
fprintf(c_file, "/* %s */\n", id_str);
|
fprintf(c_file, "/* %s */\n", id_str);
|
||||||
fprintf(c_file, "\n");
|
fprintf(c_file, "\n");
|
||||||
|
fprintf(c_file, "#ifdef HAVE_CONFIG_H\n");
|
||||||
|
fprintf(c_file, "#include <config.h>\n");
|
||||||
|
fprintf(c_file, "#endif\n");
|
||||||
fprintf(c_file, "#include <stddef.h>\n");
|
fprintf(c_file, "#include <stddef.h>\n");
|
||||||
fprintf(c_file, "#include <com_err.h>\n");
|
fprintf(c_file, "#include <com_err.h>\n");
|
||||||
fprintf(c_file, "#include \"%s\"\n", hfn);
|
fprintf(c_file, "#include \"%s\"\n", hfn);
|
||||||
|
Reference in New Issue
Block a user