From 608c1f65bda7b033a16431b3d9104d6cb0987fd1 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Thu, 17 Mar 2005 00:21:36 +0000 Subject: [PATCH] close opened files and make sure to flush stdout on exit, this used to cause weird results on windows otherwise --- BasiliskII/src/uae_cpu/build68k.c | 1 + BasiliskII/src/uae_cpu/compiler/gencomp.c | 1 + BasiliskII/src/uae_cpu/gencpu.c | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BasiliskII/src/uae_cpu/build68k.c b/BasiliskII/src/uae_cpu/build68k.c index 6d6fd55d..7b7da701 100644 --- a/BasiliskII/src/uae_cpu/build68k.c +++ b/BasiliskII/src/uae_cpu/build68k.c @@ -257,5 +257,6 @@ int main(int argc, char **argv) } } printf("};\nint n_defs68k = %d;\n", no_insns); + fflush(stdout); return 0; } diff --git a/BasiliskII/src/uae_cpu/compiler/gencomp.c b/BasiliskII/src/uae_cpu/compiler/gencomp.c index 989755c8..43e89645 100644 --- a/BasiliskII/src/uae_cpu/compiler/gencomp.c +++ b/BasiliskII/src/uae_cpu/compiler/gencomp.c @@ -3069,5 +3069,6 @@ main (int argc, char **argv) free (table68k); fclose (stblfile); fclose (headerfile); + fflush (stdout); return 0; } diff --git a/BasiliskII/src/uae_cpu/gencpu.c b/BasiliskII/src/uae_cpu/gencpu.c index 18f69046..4fdc5d5f 100644 --- a/BasiliskII/src/uae_cpu/gencpu.c +++ b/BasiliskII/src/uae_cpu/gencpu.c @@ -2470,9 +2470,9 @@ int main (int argc, char **argv) * cputbl.h that way), but cpuopti can't cope. That could be fixed, but * I don't dare to touch the 68k version. */ - headerfile = fopen ("cputbl.h", "wb"); - stblfile = fopen ("cpustbl.cpp", "wb"); - freopen ("cpuemu.cpp", "wb", stdout); + headerfile = fopen ("cputbl.h", "w"); + stblfile = fopen ("cpustbl.cpp", "w"); + FILE *out = freopen ("cpuemu.cpp", "w", stdout); generate_includes (stdout); generate_includes (stblfile); @@ -2480,5 +2480,8 @@ int main (int argc, char **argv) generate_func (); free (table68k); + fclose (headerfile); + fclose (stblfile); + fflush (out); return 0; }