* 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:
parent
a889fdb955
commit
be26c4f8fd
12
src/main.c
12
src/main.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue