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:
Jeffrey Altman
2012-04-10 17:17:33 -04:00
parent 8e2762f907
commit 9be792055c
2 changed files with 14 additions and 2 deletions

View File

@@ -79,6 +79,9 @@ generate_c(void)
if(id_str)
fprintf(c_file, "/* %s */\n", id_str);
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 <com_err.h>\n");
fprintf(c_file, "#include \"%s\"\n", hfn);