From bcc104ce79f153cd853920ff924e13f84793b61c Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Thu, 24 Mar 2011 18:20:49 -0700 Subject: A first stab at the 'nbody' demo, with support for calling C sqrt(). --- src/rt/rust_builtin.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 98333774..2de9d7f4 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -51,6 +51,11 @@ last_os_error(rust_task *task) { return st; } +extern "C" CDECL +void squareroot(rust_task *task, double *input, double *output) { + *output = sqrt(*input); +} + extern "C" CDECL size_t size_of(rust_task *task, type_desc *t) { return t->size; -- cgit v1.2.3