From b13e7e0f3dfa683471928f2a4500f1d592ada19d Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 19 Oct 2011 21:53:02 -0700 Subject: [PATCH] move fs routines to c-stack-stdlib --- src/lib/fs.rs | 2 +- src/lib/posix_fs.rs | 2 +- src/lib/win32_fs.rs | 2 +- src/rt/rust_builtin.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/fs.rs b/src/lib/fs.rs index ec389593f5b..9a539f4b826 100644 --- a/src/lib/fs.rs +++ b/src/lib/fs.rs @@ -2,7 +2,7 @@ import os::getcwd; import os_fs; -native "rust" mod rustrt { +native "c-stack-cdecl" mod rustrt { fn rust_file_is_dir(path: str::sbuf) -> int; } diff --git a/src/lib/posix_fs.rs b/src/lib/posix_fs.rs index 5ebebc2748a..3a518c7b966 100644 --- a/src/lib/posix_fs.rs +++ b/src/lib/posix_fs.rs @@ -1,5 +1,5 @@ -native "rust" mod rustrt { +native "c-stack-cdecl" mod rustrt { fn rust_list_files(&&path: str) -> [str]; } diff --git a/src/lib/win32_fs.rs b/src/lib/win32_fs.rs index e1bfb24b6d1..2fe6acd4399 100644 --- a/src/lib/win32_fs.rs +++ b/src/lib/win32_fs.rs @@ -1,6 +1,6 @@ -native "rust" mod rustrt { +native "c-stack-cdecl" mod rustrt { fn rust_list_files(&&path: str) -> [str]; fn rust_file_is_dir(&&path: str) -> int; } diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 57d682ec497..ae129a9380d 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -325,12 +325,12 @@ debug_ptrcast(type_desc *from_ty, } extern "C" CDECL rust_vec* -rust_list_files(rust_vec **path) { +rust_list_files(rust_str *path) { rust_task *task = rust_scheduler::get_task(); array_list strings; #if defined(__WIN32__) WIN32_FIND_DATA FindFileData; - HANDLE hFind = FindFirstFile((char*)(*path)->data, &FindFileData); + HANDLE hFind = FindFirstFile((char*)path->data, &FindFileData); if (hFind != INVALID_HANDLE_VALUE) { do { rust_str *str = make_str(task->kernel, FindFileData.cFileName, @@ -341,7 +341,7 @@ rust_list_files(rust_vec **path) { FindClose(hFind); } #else - DIR *dirp = opendir((char*)(*path)->data); + DIR *dirp = opendir((char*)path->data); if (dirp) { struct dirent *dp; while ((dp = readdir(dirp))) {