Skip to content

Commit 74b3037

Browse files
committed
---
yaml --- r: 892 b: refs/heads/master c: c1fb592 h: refs/heads/master v: v3
1 parent 49edb40 commit 74b3037

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 981edaef40ef30b2151c28e55a4fba5613c1cb25
2+
refs/heads/master: c1fb592f620bf29d854d64816974c478d567e578

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,8 +1197,15 @@ fn trans_main_fn(@trans_ctxt cx, ValueRef llcrate) {
11971197
auto T_main_args = vec(T_int(), T_int());
11981198
auto T_rust_start_args = vec(T_int(), T_int(), T_int(), T_int());
11991199

1200+
auto main_name;
1201+
if (_str.eq(std.os.target_os(), "win32")) {
1202+
main_name = "WinMain@16";
1203+
} else {
1204+
main_name = "main";
1205+
}
1206+
12001207
auto llmain =
1201-
decl_cdecl_fn(cx.llmod, "main", T_main_args, T_int());
1208+
decl_cdecl_fn(cx.llmod, main_name, T_main_args, T_int());
12021209

12031210
auto llrust_start =
12041211
decl_cdecl_fn(cx.llmod, "rust_start", T_rust_start_args, T_int());

0 commit comments

Comments
 (0)