diff --git a/src/main.c b/src/main.c index 2a164f8..2603e7b 100644 --- a/src/main.c +++ b/src/main.c @@ -31,19 +31,31 @@ #include "config.h" #ifdef WIN32 +# include # include #endif #include +#ifdef WIN32 +static void exit_handler () { + fprintf (stdout, "\nElk has terminated. Press return to continue.\n"); + fflush (stdin); + getchar (); +} +#endif + int main (int ac, char **av) { #ifdef WIN32 AllocConsole (); freopen ("CONIN$", "r", stdin); freopen ("CONOUT$", "w", stdout); freopen ("CONOUT$", "w", stderr); + atexit (exit_handler); #endif + Elk_Init (ac, av, 1, ""); + return 0; }