about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorPhil Ruffwind <rf@rufflewind.com>2014-05-04 03:11:42 -0400
committerPhil Ruffwind <rf@rufflewind.com>2014-05-13 17:19:00 -0400
commite12aeb39bc4221421890011006c5ae23154cc695 (patch)
tree88152484211b4ac51c81c8217dcd23135dba5700 /src/libstd
parent4537f13a877850d8a390acc2e3a80964532505b3 (diff)
downloadrust-e12aeb39bc4221421890011006c5ae23154cc695.tar.gz
rust-e12aeb39bc4221421890011006c5ae23154cc695.zip
Use CreateProcessW instead of CreateProcessA
Changed libnative to use CreateProcessW instead of CreateProcessA.  In
addition, the lpEnvironment parameter now uses Unicode.

Added a helper function os::win32::as_mut_utf16_p, which does basically
the same thing as os::win32::as_utf16_p except the pointer is mutable.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/os.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index f7324dc08b6..44c338a3091 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -141,10 +141,14 @@ pub mod win32 {
     }
 
     pub fn as_utf16_p<T>(s: &str, f: |*u16| -> T) -> T {
+        as_mut_utf16_p(s, |t| { f(t as *u16) })
+    }
+
+    pub fn as_mut_utf16_p<T>(s: &str, f: |*mut u16| -> T) -> T {
         let mut t = s.to_utf16();
         // Null terminate before passing on.
         t.push(0u16);
-        f(t.as_ptr())
+        f(t.as_mut_ptr())
     }
 }