diff options
author | Zack Weinberg <zackw@stanford.edu> | 2001-04-02 16:29:32 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-04-02 16:29:32 +0000 |
commit | 0313e85b82d26887adb3cdab1dd8ce0a135135a3 (patch) | |
tree | 113af7fdc2e163e99c91162b13799deeae6fdb8d /gcc/gengenrtl.c | |
parent | 79cb7361fad4c4b58a09c1f6e64cf81c3cf9b8dc (diff) | |
download | gcc-0313e85b82d26887adb3cdab1dd8ce0a135135a3.tar.gz |
genattr.c, [...]: Wrap generated header in multiple-include guard.
* genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c,
gengenrtl.c: Wrap generated header in multiple-include guard.
Improve error checking.
From-SVN: r41006
Diffstat (limited to 'gcc/gengenrtl.c')
-rw-r--r-- | gcc/gengenrtl.c | 13 |
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; } |