[MLton-commit] r4598

Stephen Weeks MLton@mlton.org
Wed, 24 May 2006 23:50:44 -0700


Brought Cygwin_toFullWindowsPath back to life, via an addition to
basis-ffi.def.


----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb
U   mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
U   mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb	2006-05-25 06:50:42 UTC (rev 4598)
@@ -245,7 +245,7 @@
    ../posix/posix.sig
    ../posix/posix.sml
 
-   (* ../platform/cygwin.sml *)
+   ../platform/cygwin.sml
 
    ../io/stream-io.sig
    ../io/stream-io.fun

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml	2006-05-25 06:50:42 UTC (rev 4598)
@@ -257,7 +257,6 @@
          SysCall.simpleResult'
          ({errVal = C_PId.castFromFixedInt ~1}, fn () =>
           let
-(*
              val cmd =
                 let
                    open MLton.Platform.OS
@@ -267,7 +266,6 @@
                     | MinGW => cmd
                     | _ => raise Fail "create"
                 end
-*)
           in
              PrimitiveFFI.Windows.Process.create
              (NullString.nullTerm cmd, args, env, stdin, stdout, stderr)

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml	2006-05-25 06:50:42 UTC (rev 4598)
@@ -7,10 +7,9 @@
 
 structure Cygwin =
    struct
-      structure Prim = Primitive.Cygwin
-         
       fun toFullWindowsPath p =
-         COld.CS.toString (Prim.toFullWindowsPath (NullString.nullTerm p))
+         CUtil.C_String.toString
+         (PrimitiveFFI.Cygwin.toFullWindowsPath (NullString.nullTerm p))
 
       fun toExe cmd =
          let
@@ -20,8 +19,8 @@
                let
                   val i = i - 1
                in
-                  if i < 0
-                     then addExe ()
+                  if i < 0 then
+                     addExe ()
                   else
                      let
                         val c = String.sub (cmd, i)

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml	2006-05-25 06:50:42 UTC (rev 4598)
@@ -9,6 +9,10 @@
 val (argvGet, argvSet) = _symbol "CommandLine_argv": (unit -> (C_StringArray.t)) * ((C_StringArray.t) -> unit);
 val (commandNameGet, commandNameSet) = _symbol "CommandLine_commandName": (unit -> (C_String.t)) * ((C_String.t) -> unit);
 end
+structure Cygwin = 
+struct
+val toFullWindowsPath = _import "Cygwin_toFullWindowsPath" : NullString8.t -> C_String.t;
+end
 structure Date = 
 struct
 val gmTime = _import "Date_gmTime" : (C_Time.t) ref -> (C_Int.t) C_Errno.t;

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def	2006-05-25 06:50:42 UTC (rev 4598)
@@ -1,6 +1,7 @@
 CommandLine.argc = _symbol : C_Int.t
 CommandLine.argv = _symbol : C_StringArray.t
 CommandLine.commandName = _symbol : C_String.t
+Cygwin.toFullWindowsPath = _import : NullString8.t -> C_String.t
 Date.Tm.getHour = _import : unit -> C_Int.t
 Date.Tm.getIsDst = _import : unit -> C_Int.t
 Date.Tm.getMDay = _import : unit -> C_Int.t

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c	2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c	2006-05-25 06:50:42 UTC (rev 4598)
@@ -37,11 +37,11 @@
 /*                      Cygwin                       */
 /* ------------------------------------------------- */
 
-char *Cygwin_toFullWindowsPath (char *path) {
+C_String_t Cygwin_toFullWindowsPath (NullString8_t path) {
         static char res[MAX_PATH];
 
         cygwin_conv_to_full_win32_path ((char*)path, &res[0]);
-        return &res[0];
+        return (C_String_t)&res[0];
 }
 
 /* ------------------------------------------------- */