about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-03-21 17:12:05 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-03-21 18:10:34 -0700
commitcaa22c93415bb106bced82bbabc3d9ffbef7e69c (patch)
tree2a77dc7cfb33c82dcdc83a69a423ebc4340e576e /src/rt/rust_upcall.cpp
parent35951c92dbc1bb2eeb94f7951b6186ce8239fc41 (diff)
downloadrust-caa22c93415bb106bced82bbabc3d9ffbef7e69c.tar.gz
rust-caa22c93415bb106bced82bbabc3d9ffbef7e69c.zip
Started adding support for floating-point type, floating-point literals, and logging of floats. Other operations on float probably don't work yet.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 1dba11024f4..30306104859 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -39,6 +39,13 @@ void upcall_log_int(rust_task *task, int32_t i) {
               "rust: %" PRId32 " (0x%" PRIx32 ")", i, i);
 }
 
+extern "C" CDECL
+void upcall_log_float(rust_task *task, double *f) {
+    LOG_UPCALL_ENTRY(task);
+    task->log(rust_log::UPCALL | rust_log::ULOG,
+              "rust: %12.12f", *f);
+}
+
 extern "C" CDECL void
 upcall_log_str(rust_task *task, rust_str *str) {
     LOG_UPCALL_ENTRY(task);