Use the shared C wrapper code in ghci.c too
[ghc-hetmet.git] / driver / ghci / ghci.c
1
2 #include "cwrapper.h"
3 #include "getLocation.h"
4 #include <errno.h>
5 #include <process.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <stdarg.h>
9 #include <string.h>
10
11 int main(int argc, char** argv) {
12     char *exePath;
13     char *preArgv[1];
14
15     if (getenv("_")) {
16         printf("WARNING: GHCi invoked via 'ghci.exe' in *nix-like shells (cygwin-bash, in particular)\n");
17         printf("         doesn't handle Ctrl-C well; use the 'ghcii.sh' shell wrapper instead\n");
18         fflush(stdout);
19     }
20
21     exePath = "ghc.exe";
22     preArgv[0] = "--interactive";
23
24     run(exePath, 1, preArgv, argc - 1, argv + 1);
25 }
26