From 0e5ea4d64f43cfbf91670b3d13ff3be7562d99fd Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 4 Oct 2011 18:24:30 -0700 Subject: Revert "stdlib: Migrate rust_file_is_dir() over to the C stack, and add a void type" due to build bustage on Windows This reverts commit 9698ef89a0c5513b9670f6ec56ea06de5728eb5a. --- src/lib/fs.rs | 9 +++------ src/lib/util.rs | 7 ------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/lib/fs.rs b/src/lib/fs.rs index a2e81184d01..06243b6d3aa 100644 --- a/src/lib/fs.rs +++ b/src/lib/fs.rs @@ -1,10 +1,9 @@ import os::getcwd; -import util::void; import os_fs; -native "c-stack-cdecl" mod rustrt { - fn rust_file_is_dir(unused: *void, path: *u8) -> int; +native "rust" mod rustrt { + fn rust_file_is_dir(path: str::sbuf) -> int; } fn path_sep() -> str { ret str::from_char(os_fs::path_sep); } @@ -53,9 +52,7 @@ fn connect_many(paths: [path]) : vec::is_not_empty(paths) -> path { } fn file_is_dir(p: path) -> bool { - ret str::as_buf(p, { - |buf| rustrt::rust_file_is_dir(ptr::null(), buf) != 0 - }); + ret str::as_buf(p, {|buf| rustrt::rust_file_is_dir(buf) != 0 }); } fn list_dir(p: path) -> [str] { diff --git a/src/lib/util.rs b/src/lib/util.rs index eb1790f569d..1d9c28d99e4 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -17,13 +17,6 @@ pure fn rational_leq(x: rational, y: rational) -> bool { } pure fn orb(a: bool, b: bool) -> bool { a || b } - -// An unconstructible type. Currently we're using this for unused parameters -// in native functions, but it may be useful for other purposes as well. -tag void { - void(@void); -} - // Local Variables: // mode: rust; // fill-column: 78; -- cgit 1.4.1-3-g733a5