[MLton] MinGW hosted MLton

Stephen Weeks MLton@mlton.org
Wed, 4 May 2005 14:41:50 -0700


> While it may be simpler, it doesn't appear to be a fix.  I still
> find MLton_Process_cwait unbound in the final program.

Indeed.  I had checked it on a small program, where it worked fine,
but not on a self compile.  In an effort to keep the fix as clean as
possible, I changed the code in posix/primitive.sml that imports cwait
to the following.

            val cwait =
	       if let
		     open Primitive.MLton.Platform.OS
		  in
		     case host of
			Cygwin => true
		      | MinGW => true
		      | _ => false
		  end
		  then _import "MLton_Process_cwait": Pid.t * Status.t ref -> Pid.t;
	       else fn _ => raise Fail "cwait not defined"

That works on a self compile, and I think it best expresses what's
going on.