diff options
author | vlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826> | 2004-08-11 05:21:32 +0000 |
---|---|---|
committer | vlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826> | 2004-08-11 05:21:32 +0000 |
commit | 33a4ff13f4e1798546d0fad6cd08add7a6021f9b (patch) | |
tree | 8bb877f95e3276f9ab8e9a225a10dd137e7d57f0 /libasn1compiler/asn1c_save.c | |
parent | 8098252ba2e49e3bcabbb573aedf4a0b7f430636 (diff) |
removed duplicate includes; moved CHOICE enumeration to higher level
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@77 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'libasn1compiler/asn1c_save.c')
-rw-r--r-- | libasn1compiler/asn1c_save.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libasn1compiler/asn1c_save.c b/libasn1compiler/asn1c_save.c index 3d806bc0..5a8d3b6e 100644 --- a/libasn1compiler/asn1c_save.c +++ b/libasn1compiler/asn1c_save.c @@ -180,6 +180,9 @@ asn1c_save_streams(arg_t *arg) { fprintf(fp_h, "#include <constr_TYPE.h>\n\n"); + TQ_FOR(ot, &(cs->targets[OT_INCLUDES]), next) + fwrite(ot->buf, ot->len, 1, fp_h); + fprintf(fp_h, "\n"); TQ_FOR(ot, &(cs->targets[OT_DEPS]), next) fwrite(ot->buf, ot->len, 1, fp_h); fprintf(fp_h, "\n"); @@ -189,17 +192,17 @@ asn1c_save_streams(arg_t *arg) { TQ_FOR(ot, &(cs->targets[OT_FUNC_DECLS]), next) fwrite(ot->buf, ot->len, 1, fp_h); - fprintf(fp_c, "#include <%s.h>\n\n", expr->Identifier); + fprintf(fp_h, "\n#ifdef __cplusplus\n}\n#endif\n\n" + "#endif\t/* _%s_H_ */\n", + header_id); + + fprintf(fp_c, "#include <%s.h>\n\n", expr->Identifier); /* Myself */ TQ_FOR(ot, &(cs->targets[OT_STAT_DEFS]), next) fwrite(ot->buf, ot->len, 1, fp_c); TQ_FOR(ot, &(cs->targets[OT_CODE]), next) fwrite(ot->buf, ot->len, 1, fp_c); - assert(OT_MAX == 5); - - fprintf(fp_h, "\n#ifdef __cplusplus\n}\n#endif\n\n" - "#endif\t/* _%s_H_ */\n", - header_id); + assert(OT_MAX == 6); fclose(fp_c); fclose(fp_h); |