diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-02 16:29:32 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-02 16:29:32 +0000 |
commit | d0c809e14ba0a2911203898049d7a30468adc86b (patch) | |
tree | 113af7fdc2e163e99c91162b13799deeae6fdb8d /gcc/genconfig.c | |
parent | 4c47007a5147737df6bd83a6adc9201489301998 (diff) | |
download | gcc-d0c809e14ba0a2911203898049d7a30468adc86b.tar.gz |
* genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c,
gengenrtl.c: Wrap generated header in multiple-include guard.
Improve error checking.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41006 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genconfig.c')
-rw-r--r-- | gcc/genconfig.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 01bbd817e09..bd61827d163 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -280,8 +280,10 @@ main (argc, argv) if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE) return (FATAL_EXIT_CODE); - printf ("/* Generated automatically by the program `genconfig'\n\ -from the machine description file `md'. */\n\n"); + puts ("/* Generated automatically by the program `genconfig'"); + puts (" from the machine description file `md'. */\n"); + puts ("#ifndef GCC_INSN_CONFIG_H"); + puts ("#define GCC_INSN_CONFIG_H\n"); /* Allow at least 10 operands for the sake of asm constructs. */ max_recog_operands = 9; /* We will add 1 later. */ @@ -356,8 +358,12 @@ from the machine description file `md'. */\n\n"); printf ("#define MAX_INSNS_PER_PEEP2 %d\n", max_insns_per_peep2); } - fflush (stdout); - return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + puts("\n#endif /* GCC_INSN_CONFIG_H */"); + + if (ferror (stdout) || fflush (stdout) || fclose (stdout)) + return FATAL_EXIT_CODE; + + return SUCCESS_EXIT_CODE; } /* Define this so we can link with print-rtl.o to get debug_rtx function. */ |