Add an OS-specific dylib_filename() function to the standard library

This commit is contained in:
Patrick Walton 2011-03-15 16:56:59 -07:00
parent 7d32f3d052
commit a8d8ea3cf3
3 changed files with 12 additions and 0 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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,