about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-10-14 20:54:11 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-10-20 13:15:09 +0200
commite927df17f7f9c150fcbfd566927ad29ff5eb6f15 (patch)
tree0811b3951844240012eac5d08a59298474b86334 /src/rt/rust_builtin.cpp
parent243c5c34790eaba815c2786009b10c31bc04c63d (diff)
downloadrust-e927df17f7f9c150fcbfd566927ad29ff5eb6f15.tar.gz
rust-e927df17f7f9c150fcbfd566927ad29ff5eb6f15.zip
Remove spawn_wrap and main_wrap kludges
This isn't needed now that our functions are cdecl (and was apparently
only still working by accident).

Issue #992
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 314e85eecc4..bfa598b5152 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -472,13 +472,18 @@ struct fn_env_pair {
     intptr_t env;
 };
 
-extern "C" CDECL uintptr_t get_spawn_wrapper();
+// FIXME This is probably not needed at all anymore. Have to rearrange some
+// argument passing to remove it.
+void rust_spawn_wrapper(void* retptr, rust_task* taskptr, void* envptr,
+                        void(*func)(void*, rust_task*, void*)) {
+    func(retptr, taskptr, envptr);
+}
 
 extern "C" CDECL void
 start_task(void *unused_task, rust_task_id id, fn_env_pair *f) {
     rust_task *task = rust_scheduler::get_task();
     rust_task *target = task->kernel->get_task_by_id(id);
-    target->start(get_spawn_wrapper(), f->f, f->env);
+    target->start((uintptr_t)rust_spawn_wrapper, f->f, f->env);
     target->deref();
 }