From 0f9d460e24ce9e1c09450f71502f1ab0700c0419 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 25 Mar 2011 00:09:20 -0700 Subject: [PATCH] Placate win32 build; no idea how it can be working currently on tinderbox. --- Makefile.in | 6 +++--- src/rt/rust_builtin.cpp | 11 ++++++++++- src/rt/rust_run_program.cpp | 6 ++++++ src/rt/rustrt.def.in | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5ddf5b784e7..ca404b1e24a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1081,7 +1081,7 @@ CRATE_DEPFILES := $(subst $(S)src/,,$(ALL_TEST_CRATES:%.rc=%.d)) \ boot/$(CFG_STDLIB).d: $(STDLIB_CRATE) $(STDLIB_INPUTS) \ $(MKFILES) boot/rustboot$(X) @$(call E, dep: $@) - $(BOOT) -o $(patsubst %.d,%,$@) -shared -rdeps $< >$@.tmp + $(BOOT) -o $(patsubst %.d,%$(X),$@) -shared -rdeps $< >$@.tmp $(Q)$(CFG_PATH_MUNGE) $@.tmp $(Q)rm -f $@.tmp.bak $(Q)mv $@.tmp $@ @@ -1089,14 +1089,14 @@ boot/$(CFG_STDLIB).d: $(STDLIB_CRATE) $(STDLIB_INPUTS) \ stage0/rustc$(X).d: $(COMPILER_CRATE) $(COMPILER_INPUTS) \ $(STDLIB_CRATE) $(MKFILES) boot/rustboot$(X) @$(call E, dep: $@) - $(BOOT) -o $(patsubst %.d,%,$@) -shared -rdeps $< >$@.tmp + $(BOOT) -o $(patsubst %.d,%$(X),$@) -shared -rdeps $< >$@.tmp $(Q)$(CFG_PATH_MUNGE) $@.tmp $(Q)rm -f $@.tmp.bak $(Q)mv $@.tmp $@ %.d: %.rc $(MKFILES) boot/rustboot$(X) @$(call E, dep: $@) - $(BOOT) -o $(patsubst %.d,%,$@) -rdeps $< >$@.tmp + $(BOOT) -o $(patsubst %.d,%$(X),$@) -rdeps $< >$@.tmp $(Q)$(CFG_PATH_MUNGE) $@.tmp $(Q)rm -f $@.tmp.bak $(Q)mv $@.tmp $@ diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 2de9d7f47ac..3f2ae511551 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -417,9 +417,9 @@ rust_str* c_str_to_rust(rust_task *task, char const *str) { return vec_alloc_with_data(task, len, len, 1, (void*)str); } -#if defined(__WIN32__) extern "C" CDECL rust_vec* rust_list_files(rust_task *task, rust_str *path) { +#if defined(__WIN32__) array_list strings; WIN32_FIND_DATA FindFileData; HANDLE hFind = FindFirstFile((char*)path->data, &FindFileData); @@ -431,6 +431,15 @@ rust_list_files(rust_task *task, rust_str *path) { } return vec_alloc_with_data(task, strings.size(), strings.size(), sizeof(rust_str*), strings.data()); +#else + return NULL; +#endif +} + +#if defined(__WIN32__) +extern "C" CDECL rust_str * +rust_dirent_filename(rust_task *task, void* ent) { + return NULL; } #else extern "C" CDECL rust_str * diff --git a/src/rt/rust_run_program.cpp b/src/rt/rust_run_program.cpp index 5919f68e844..7b73586e9c8 100644 --- a/src/rt/rust_run_program.cpp +++ b/src/rt/rust_run_program.cpp @@ -76,6 +76,12 @@ rust_run_program(rust_task* task, char* argv[], exit(1); } +extern "C" CDECL int +rust_process_wait(void* task, int proc) { + // FIXME: stub; exists to placate linker. + return 0; +} + #else #error "Platform not supported." #endif diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index df9e26aff9e..be51770a9d2 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -17,6 +17,8 @@ rust_dirent_filename rust_file_is_dir rust_get_stdin rust_get_stdout +rust_list_files +rust_process_wait rust_run_program rust_start size_of