summaryrefslogtreecommitdiff
path: root/gcc/genflags.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genflags.c')
-rw-r--r--gcc/genflags.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 73e8bc7475e..0ff0377d6a5 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -233,8 +233,10 @@ main (argc, argv)
if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
- printf ("/* Generated automatically by the program `genflags'\n\
-from the machine description file `md'. */\n\n");
+ puts ("/* Generated automatically by the program `genflags'");
+ puts (" from the machine description file `md'. */\n");
+ puts ("#ifndef GCC_INSN_FLAGS_H");
+ puts ("#define GCC_INSN_FLAGS_H\n");
/* Read the machine description. */
@@ -258,8 +260,12 @@ from the machine description file `md'. */\n\n");
for (insn_ptr = insns; *insn_ptr; insn_ptr++)
gen_proto (*insn_ptr);
- fflush (stdout);
- return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+ puts("\n#endif /* GCC_INSN_FLAGS_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. */