aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/x86.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/comp/back/x86.rs b/src/comp/back/x86.rs
index 0a5fc506..22ee3da3 100644
--- a/src/comp/back/x86.rs
+++ b/src/comp/back/x86.rs
@@ -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,