summaryrefslogtreecommitdiff
path: root/gcc/gengenrtl.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-02 16:29:32 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-02 16:29:32 +0000
commitd0c809e14ba0a2911203898049d7a30468adc86b (patch)
tree113af7fdc2e163e99c91162b13799deeae6fdb8d /gcc/gengenrtl.c
parent4c47007a5147737df6bd83a6adc9201489301998 (diff)
downloadgcc-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/gengenrtl.c')
-rw-r--r--gcc/gengenrtl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index d656b4aca3c..21f46df1461 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -351,7 +351,10 @@ genheader ()
{
int i;
const char **fmt;
-
+
+ puts ("#ifndef GCC_GENRTL_H");
+ puts ("#define GCC_GENRTL_H\n");
+
for (fmt = formats; *fmt; ++fmt)
gendecl (*fmt);
@@ -360,6 +363,8 @@ genheader ()
for (i = 0; i < NUM_RTX_CODE; i++)
if (! special_format (defs[i].format))
genmacro (i);
+
+ puts ("\n#endif /* GCC_GENRTL_H */");
}
/* Generate the text of the code file we write, genrtl.c. */
@@ -420,6 +425,8 @@ main (argc, argv)
else
gencode ();
- fflush (stdout);
- return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+ if (ferror (stdout) || fflush (stdout) || fclose (stdout))
+ return FATAL_EXIT_CODE;
+
+ return SUCCESS_EXIT_CODE;
}