about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorHaitao Li <lihaitao@gmail.com>2012-01-16 18:21:01 +0800
committerHaitao Li <lihaitao@gmail.com>2012-01-19 02:10:36 +0800
commitdde41869ce2ef1d66e753fc8b4efc7d917c77875 (patch)
treeee9ea278fa981a8188a7d4cdb11201df10a81478 /src/libstd
parentf03eb96f39dd616d8213cadf337b9d0b0984a687 (diff)
downloadrust-dde41869ce2ef1d66e753fc8b4efc7d917c77875.tar.gz
rust-dde41869ce2ef1d66e753fc8b4efc7d917c77875.zip
Use ctypes in native function declarations
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/dbg.rs3
-rw-r--r--src/libstd/fs.rs8
-rw-r--r--src/libstd/test.rs3
3 files changed, 8 insertions, 6 deletions
diff --git a/src/libstd/dbg.rs b/src/libstd/dbg.rs
index ea98150d76a..e1f82fedda0 100644
--- a/src/libstd/dbg.rs
+++ b/src/libstd/dbg.rs
@@ -14,7 +14,8 @@ native mod rustrt {
     fn debug_opaque<T>(td: *sys::type_desc, x: T);
     fn debug_box<T>(td: *sys::type_desc, x: @T);
     fn debug_tag<T>(td: *sys::type_desc, x: T);
-    fn debug_obj<T>(td: *sys::type_desc, x: T, nmethods: uint, nbytes: uint);
+    fn debug_obj<T>(td: *sys::type_desc, x: T,
+                    nmethods: ctypes::size_t, nbytes: ctypes::size_t);
     fn debug_fn<T>(td: *sys::type_desc, x: T);
     fn debug_ptrcast<T, U>(td: *sys::type_desc, x: @T) -> @U;
 }
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index 5a4bcbde101..fe06e2a89aa 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -13,8 +13,8 @@ import os_fs;
 
 #[abi = "cdecl"]
 native mod rustrt {
-    fn rust_path_is_dir(path: str::sbuf) -> int;
-    fn rust_path_exists(path: str::sbuf) -> int;
+    fn rust_path_is_dir(path: str::sbuf) -> ctypes::c_int;
+    fn rust_path_exists(path: str::sbuf) -> ctypes::c_int;
 }
 
 /*
@@ -120,7 +120,7 @@ Function: path_is_dir
 Indicates whether a path represents a directory.
 */
 fn path_is_dir(p: path) -> bool {
-    ret str::as_buf(p, {|buf| rustrt::rust_path_is_dir(buf) != 0 });
+    ret str::as_buf(p, {|buf| rustrt::rust_path_is_dir(buf) != 0i32 });
 }
 
 /*
@@ -129,7 +129,7 @@ Function: path_exists
 Indicates whether a path exists.
 */
 fn path_exists(p: path) -> bool {
-    ret str::as_buf(p, {|buf| rustrt::rust_path_exists(buf) != 0 });
+    ret str::as_buf(p, {|buf| rustrt::rust_path_exists(buf) != 0i32 });
 }
 
 /*
diff --git a/src/libstd/test.rs b/src/libstd/test.rs
index 7dbe8659679..3d58a71f950 100644
--- a/src/libstd/test.rs
+++ b/src/libstd/test.rs
@@ -5,6 +5,7 @@
 
 import result::{ok, err};
 import io::writer_util;
+import core::ctypes;
 
 export test_name;
 export test_fn;
@@ -28,7 +29,7 @@ export joinable;
 
 #[abi = "cdecl"]
 native mod rustrt {
-    fn sched_threads() -> uint;
+    fn sched_threads() -> ctypes::size_t;
 }
 
 // The name of a test. By convention this follows the rules for rust