about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-11-02 16:23:22 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-11-09 22:55:50 -0800
commit3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11 (patch)
tree343087c9e62da65e2780db851682280697064c5b /src/libsyntax
parentc8a29c2092cec369a751051a2bfed093522ff6e8 (diff)
downloadrust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.tar.gz
rust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.zip
std: Migrate to the new libc
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/diagnostic.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs
index 2b34db3f6ea..f1fd8be4728 100644
--- a/src/libsyntax/diagnostic.rs
+++ b/src/libsyntax/diagnostic.rs
@@ -21,7 +21,6 @@ use std::{cmp, error, fmt};
 use std::io::prelude::*;
 use std::io;
 use term::{self, WriterWrapper};
-use libc;
 
 /// maximum number of lines we will print for each error; arbitrary.
 const MAX_LINES: usize = 6;
@@ -767,15 +766,19 @@ impl EmitterWriter {
 
 #[cfg(unix)]
 fn stderr_isatty() -> bool {
+    use libc;
     unsafe { libc::isatty(libc::STDERR_FILENO) != 0 }
 }
 #[cfg(windows)]
 fn stderr_isatty() -> bool {
-    const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
+    type DWORD = u32;
+    type BOOL = i32;
+    type HANDLE = *mut u8;
+    const STD_ERROR_HANDLE: DWORD = -12i32 as DWORD;
     extern "system" {
-        fn GetStdHandle(which: libc::DWORD) -> libc::HANDLE;
-        fn GetConsoleMode(hConsoleHandle: libc::HANDLE,
-                          lpMode: libc::LPDWORD) -> libc::BOOL;
+        fn GetStdHandle(which: DWORD) -> HANDLE;
+        fn GetConsoleMode(hConsoleHandle: HANDLE,
+                          lpMode: *mut DWORD) -> BOOL;
     }
     unsafe {
         let handle = GetStdHandle(STD_ERROR_HANDLE);