aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorLindsey Kuper <[email protected]>2011-03-24 18:20:49 -0700
committerGraydon Hoare <[email protected]>2011-03-25 00:15:56 -0700
commitbcc104ce79f153cd853920ff924e13f84793b61c (patch)
treeb751831c7db8f242cb1097f5e07c44cbb8556bd8 /src/rt/rust_builtin.cpp
parentbuild: Generate an object file for stage0/libstd.dylib (diff)
downloadrust-bcc104ce79f153cd853920ff924e13f84793b61c.tar.xz
rust-bcc104ce79f153cd853920ff924e13f84793b61c.zip
A first stab at the 'nbody' demo, with support for calling C sqrt().
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp5
1 files changed, 5 insertions, 0 deletions
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;