Merge branch 'master' of github.com:graydon/rust
This commit is contained in:
commit
cb254f3558
4 changed files with 16 additions and 0 deletions
|
@ -2,6 +2,7 @@ import lib.llvm.llvm;
|
||||||
import lib.llvm.llvm.ModuleRef;
|
import lib.llvm.llvm.ModuleRef;
|
||||||
import std._str;
|
import std._str;
|
||||||
import std._vec;
|
import std._vec;
|
||||||
|
import std.os.target_os;
|
||||||
import util.common.istr;
|
import util.common.istr;
|
||||||
|
|
||||||
const int wordsz = 4;
|
const int wordsz = 4;
|
||||||
|
@ -128,7 +129,11 @@ fn decl_upcall_glue(int align, str prefix, uint n) -> str {
|
||||||
|
|
||||||
fn get_module_asm() -> str {
|
fn get_module_asm() -> str {
|
||||||
auto align = 4;
|
auto align = 4;
|
||||||
|
|
||||||
auto prefix = "";
|
auto prefix = "";
|
||||||
|
if (target_os() == "macos") {
|
||||||
|
prefix = "_";
|
||||||
|
}
|
||||||
|
|
||||||
auto glues =
|
auto glues =
|
||||||
vec(decl_glue(align, prefix,
|
vec(decl_glue(align, prefix,
|
||||||
|
|
|
@ -47,6 +47,9 @@ fn exec_suffix() -> str {
|
||||||
ret "";
|
ret "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn target_os() -> str {
|
||||||
|
ret "linux";
|
||||||
|
}
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: rust;
|
// mode: rust;
|
||||||
|
|
|
@ -47,6 +47,10 @@ fn exec_suffix() -> str {
|
||||||
ret "";
|
ret "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn target_os() -> str {
|
||||||
|
ret "macos";
|
||||||
|
}
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: rust;
|
// mode: rust;
|
||||||
// fill-column: 78;
|
// fill-column: 78;
|
||||||
|
|
|
@ -38,6 +38,10 @@ fn exec_suffix() -> str {
|
||||||
ret ".exe";
|
ret ".exe";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn target_os() -> str {
|
||||||
|
ret "win32";
|
||||||
|
}
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: rust;
|
// mode: rust;
|
||||||
// fill-column: 78;
|
// fill-column: 78;
|
||||||
|
|
Loading…
Reference in a new issue