Skip to content

Commit 82629a1

Browse files
committed
---
yaml --- r: 5671 b: refs/heads/master c: 9698ef8 h: refs/heads/master i: 5669: 549c074 5667: 35598c0 5663: 48deb49 v: v3
1 parent 102dbdb commit 82629a1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 990233eb3d0b8b609a861f137c91cc5d6163265b
2+
refs/heads/master: 9698ef89a0c5513b9670f6ec56ea06de5728eb5a

trunk/src/lib/fs.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

22
import os::getcwd;
3+
import util::void;
34
import os_fs;
45

5-
native "rust" mod rustrt {
6-
fn rust_file_is_dir(path: str::sbuf) -> int;
6+
native "c-stack-cdecl" mod rustrt {
7+
fn rust_file_is_dir(unused: *void, path: *u8) -> int;
78
}
89

910
fn path_sep() -> str { ret str::from_char(os_fs::path_sep); }
@@ -52,7 +53,9 @@ fn connect_many(paths: [path]) : vec::is_not_empty(paths) -> path {
5253
}
5354

5455
fn file_is_dir(p: path) -> bool {
55-
ret str::as_buf(p, {|buf| rustrt::rust_file_is_dir(buf) != 0 });
56+
ret str::as_buf(p, {
57+
|buf| rustrt::rust_file_is_dir(ptr::null(), buf) != 0
58+
});
5659
}
5760

5861
fn list_dir(p: path) -> [str] {

trunk/src/lib/util.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ pure fn rational_leq(x: rational, y: rational) -> bool {
1717
}
1818

1919
pure fn orb(a: bool, b: bool) -> bool { a || b }
20+
21+
// An unconstructible type. Currently we're using this for unused parameters
22+
// in native functions, but it may be useful for other purposes as well.
23+
tag void {
24+
void(@void);
25+
}
26+
2027
// Local Variables:
2128
// mode: rust;
2229
// fill-column: 78;

0 commit comments

Comments
 (0)