close opened files and make sure to flush stdout on exit, this used to

cause weird results on windows otherwise
This commit is contained in:
gbeauche 2005-03-17 00:21:36 +00:00
parent fcb323c511
commit 608c1f65bd
3 changed files with 8 additions and 3 deletions

View File

@ -257,5 +257,6 @@ int main(int argc, char **argv)
} }
} }
printf("};\nint n_defs68k = %d;\n", no_insns); printf("};\nint n_defs68k = %d;\n", no_insns);
fflush(stdout);
return 0; return 0;
} }

View File

@ -3069,5 +3069,6 @@ main (int argc, char **argv)
free (table68k); free (table68k);
fclose (stblfile); fclose (stblfile);
fclose (headerfile); fclose (headerfile);
fflush (stdout);
return 0; return 0;
} }

View File

@ -2470,9 +2470,9 @@ int main (int argc, char **argv)
* cputbl.h that way), but cpuopti can't cope. That could be fixed, but * cputbl.h that way), but cpuopti can't cope. That could be fixed, but
* I don't dare to touch the 68k version. */ * I don't dare to touch the 68k version. */
headerfile = fopen ("cputbl.h", "wb"); headerfile = fopen ("cputbl.h", "w");
stblfile = fopen ("cpustbl.cpp", "wb"); stblfile = fopen ("cpustbl.cpp", "w");
freopen ("cpuemu.cpp", "wb", stdout); FILE *out = freopen ("cpuemu.cpp", "w", stdout);
generate_includes (stdout); generate_includes (stdout);
generate_includes (stblfile); generate_includes (stblfile);
@ -2480,5 +2480,8 @@ int main (int argc, char **argv)
generate_func (); generate_func ();
free (table68k); free (table68k);
fclose (headerfile);
fclose (stblfile);
fflush (out);
return 0; return 0;
} }