* Allocate a console under Win32, and wait for user input before closing it.

git-svn-id: svn://svn.zoy.org/elk/trunk@145 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-09-11 10:09:27 +00:00
parent a889fdb955
commit be26c4f8fd
1 changed files with 12 additions and 0 deletions

View File

@ -31,19 +31,31 @@
#include "config.h"
#ifdef WIN32
# include <stdlib.h>
# include <windows.h>
#endif
#include <scheme.h>
#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;
}