about summary refs log tree commit diff
path: root/src/libstd/sys/windows/process.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2018-03-03 18:29:30 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2018-03-03 18:44:44 -0800
commit74c5c6e6cb0425284f57fece6fbf248e827ea06d (patch)
treed6c4863688aedf2527b3fa2dd806704b5ae0c33e /src/libstd/sys/windows/process.rs
parent2ce2b40ee5f847f02d6da1b81f3303b8e8b23531 (diff)
downloadrust-74c5c6e6cb0425284f57fece6fbf248e827ea06d.tar.gz
rust-74c5c6e6cb0425284f57fece6fbf248e827ea06d.zip
Move process::ExitCode internals to sys
Now begins the saga of fixing compilation errors on other platforms...
Diffstat (limited to 'src/libstd/sys/windows/process.rs')
-rw-r--r--src/libstd/sys/windows/process.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index c93179869a6..f1ab9c47609 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -18,7 +18,7 @@ use ffi::{OsString, OsStr};
 use fmt;
 use fs;
 use io::{self, Error, ErrorKind};
-use libc::c_void;
+use libc::{c_void, EXIT_SUCCESS, EXIT_FAILURE};
 use mem;
 use os::windows::ffi::OsStrExt;
 use path::Path;
@@ -408,6 +408,18 @@ impl fmt::Display for ExitStatus {
     }
 }
 
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct ExitCode(c::DWORD);
+
+impl ExitCode {
+    pub const SUCCESS: ExitCode = ExitCode(EXIT_SUCCESS as _);
+    pub const FAILURE: ExitCode = ExitCode(EXIT_FAILURE as _);
+
+    pub fn as_i32(&self) -> i32 {
+        self.0 as i32
+    }
+}
+
 fn zeroed_startupinfo() -> c::STARTUPINFO {
     c::STARTUPINFO {
         cb: 0,