diff options
| author | Graydon Hoare <[email protected]> | 2010-11-05 18:28:51 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-05 18:31:22 -0700 |
| commit | c1fb592f620bf29d854d64816974c478d567e578 (patch) | |
| tree | 5e8f7e5c7efbc095f894c8c21f130eb31d3b428c /src/comp | |
| parent | Fix two incorrect block-context uses in rustc. (diff) | |
| download | rust-c1fb592f620bf29d854d64816974c478d567e578.tar.xz rust-c1fb592f620bf29d854d64816974c478d567e578.zip | |
Emit WinMain@16 entrypoint on windows.
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index cfa12f20..f0b85563 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1197,8 +1197,15 @@ fn trans_main_fn(@trans_ctxt cx, ValueRef llcrate) { auto T_main_args = vec(T_int(), T_int()); auto T_rust_start_args = vec(T_int(), T_int(), T_int(), T_int()); + auto main_name; + if (_str.eq(std.os.target_os(), "win32")) { + main_name = "WinMain@16"; + } else { + main_name = "main"; + } + auto llmain = - decl_cdecl_fn(cx.llmod, "main", T_main_args, T_int()); + decl_cdecl_fn(cx.llmod, main_name, T_main_args, T_int()); auto llrust_start = decl_cdecl_fn(cx.llmod, "rust_start", T_rust_start_args, T_int()); |