Move symbol prefix logic into separate function, add underscore prefix for windows.

This commit is contained in:
Graydon Hoare 2010-11-05 18:29:18 -07:00
parent c1fb592f62
commit ffb3861c70

View File

@ -127,13 +127,19 @@ fn decl_upcall_glue(int align, str prefix, uint n) -> str {
upcall_glue(i));
}
fn get_symbol_prefix() -> str {
if (_str.eq(target_os(), "macos") ||
_str.eq(target_os(), "win32")) {
ret "_";
} else {
ret "";
}
}
fn get_module_asm() -> str {
auto align = 4;
auto prefix = "";
if (_str.eq(target_os(), "macos")) {
prefix = "_";
}
auto prefix = get_symbol_prefix();
auto glues =
vec(decl_glue(align, prefix,