about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorStefan Plantikow <stefan.plantikow@googlemail.com>2011-12-14 12:09:01 +0100
committerGraydon Hoare <graydon@mozilla.com>2011-12-14 14:54:16 -0800
commitaf8e471908841ff2ca925b49871dae4c68ddf86e (patch)
treee84b1e37f32438e10e0bf191ffe1f0dd80812acd /src/libstd
parent50db7ce906b9731a5dc02a1a87fbe87f55f13b42 (diff)
downloadrust-af8e471908841ff2ca925b49871dae4c68ddf86e.tar.gz
rust-af8e471908841ff2ca925b49871dae4c68ddf86e.zip
Fixed type resolution error in math tests
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/mtypes.rs64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/libstd/mtypes.rs b/src/libstd/mtypes.rs
new file mode 100644
index 00000000000..cddea420cc8
--- /dev/null
+++ b/src/libstd/mtypes.rs
@@ -0,0 +1,64 @@
+/*
+
+Module: mtypes
+
+Machine type equivalents of rust int, uint, float, and complex.
+
+Types useful for interop with C when writing bindings that exist
+for different types (float, f32, f64, ...; cf float.rs for an example)
+*/
+
+export m_int, m_uint, m_float;
+
+// PORT Change this when porting to a new architecture
+
+/*
+Type: m_int
+
+Machine type equivalent of an int
+*/
+#[cfg(target_arch="x86")]
+type m_int = i32;
+#[cfg(target_arch="x86_64")]
+type m_int = i64;
+
+// PORT Change this when porting to a new architecture
+
+/*
+Type: m_uint
+
+Machine type equivalent of a uint
+*/
+#[cfg(target_arch="x86")]
+type m_uint = u32;
+#[cfg(target_arch="x86_64")]
+type m_uint = u64;
+
+// PORT *must* match with "import m_float = fXX" in std::math per arch
+
+/*
+Type: m_float
+
+Machine type equivalent of a float
+*/
+type m_float = f64;
+
+// PORT  *must* match "import m_complex = ..." in std::complex per arch
+
+/*
+FIXME Type m_complex
+
+Machine type representing a complex value that uses floats for
+both the real and the imaginary part.
+*/
+// type m_complex = complex_c64::t;
+
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//