1996-02-22 04:53:13 -08:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1996-02-22 04:53:13 -08:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1996-02-22 04:53:13 -08:00
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1998-02-27 06:07:09 -08:00
|
|
|
#include <wtypes.h>
|
|
|
|
#include <winbase.h>
|
1996-02-22 04:53:13 -08:00
|
|
|
#include <process.h>
|
|
|
|
|
1996-05-09 07:59:22 -07:00
|
|
|
char * runtime_name = "ocamlrun.exe";
|
|
|
|
char * errmsg = "Cannot find ocamlrun.exe\n";
|
1996-02-22 04:53:13 -08:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
int main(int argc, char ** argv)
|
1996-02-22 04:53:13 -08:00
|
|
|
{
|
|
|
|
int retcode;
|
1998-02-27 06:07:09 -08:00
|
|
|
char * cmdline = GetCommandLine();
|
|
|
|
retcode = spawnlp(P_WAIT, runtime_name, cmdline, NULL);
|
1996-02-22 04:53:13 -08:00
|
|
|
/* We use P_WAIT instead of P_OVERLAY here because under NT,
|
|
|
|
P_OVERLAY returns to the command interpreter, displaying the prompt
|
|
|
|
before executing the command. */
|
|
|
|
if (retcode == -1) {
|
|
|
|
write(2, errmsg, strlen(errmsg));
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
return retcode;
|
|
|
|
}
|
1998-02-27 06:07:09 -08:00
|
|
|
|
|
|
|
/* Prevent VC++ from linking its own _setargv function, which
|
|
|
|
performs command-line processing (we don't need it) */
|
|
|
|
|
|
|
|
static void _setargv() { }
|