aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-15 16:56:59 -0700
committerPatrick Walton <[email protected]>2011-03-15 16:56:59 -0700
commita8d8ea3cf39c7a694dcefc6226233ddbbf904ec2 (patch)
tree04bd954ba328112faaaccd8d311b5c473e22d914
parentrustc: Add a stub crate reader module for "use" directives (diff)
downloadrust-a8d8ea3cf39c7a694dcefc6226233ddbbf904ec2.tar.xz
rust-a8d8ea3cf39c7a694dcefc6226233ddbbf904ec2.zip
Add an OS-specific dylib_filename() function to the standard library
-rw-r--r--src/lib/linux_os.rs4
-rw-r--r--src/lib/macos_os.rs4
-rw-r--r--src/lib/win32_os.rs4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/linux_os.rs b/src/lib/linux_os.rs
index 6695377d..81b4781a 100644
--- a/src/lib/linux_os.rs
+++ b/src/lib/linux_os.rs
@@ -57,6 +57,10 @@ fn target_os() -> str {
ret "linux";
}
+fn dylib_filename(str base) -> str {
+ ret "lib" + base + ".so";
+}
+
fn pipe() -> tup(int, int) {
let vec[mutable int] fds = vec(mutable 0, 0);
check(os.libc.pipe(_vec.buf[mutable int](fds)) == 0);
diff --git a/src/lib/macos_os.rs b/src/lib/macos_os.rs
index fff52897..c2a1bee3 100644
--- a/src/lib/macos_os.rs
+++ b/src/lib/macos_os.rs
@@ -54,6 +54,10 @@ fn target_os() -> str {
ret "macos";
}
+fn dylib_filename(str base) -> str {
+ ret "lib" + base + ".dylib";
+}
+
fn pipe() -> tup(int, int) {
let vec[mutable int] fds = vec(mutable 0, 0);
check(os.libc.pipe(_vec.buf[mutable int](fds)) == 0);
diff --git a/src/lib/win32_os.rs b/src/lib/win32_os.rs
index 56c65bfc..6885be24 100644
--- a/src/lib/win32_os.rs
+++ b/src/lib/win32_os.rs
@@ -42,6 +42,10 @@ fn target_os() -> str {
ret "win32";
}
+fn dylib_filename(str base) -> str {
+ ret base + ".dll";
+}
+
fn pipe() -> tup(int, int) {
let vec[mutable int] fds = vec(mutable 0, 0);
check(os.libc._pipe(_vec.buf[mutable int](fds), 1024u,