We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 981edae commit c1fb592Copy full SHA for c1fb592
src/comp/middle/trans.rs
@@ -1197,8 +1197,15 @@ fn trans_main_fn(@trans_ctxt cx, ValueRef llcrate) {
1197
auto T_main_args = vec(T_int(), T_int());
1198
auto T_rust_start_args = vec(T_int(), T_int(), T_int(), T_int());
1199
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
+
1207
auto llmain =
- decl_cdecl_fn(cx.llmod, "main", T_main_args, T_int());
1208
+ decl_cdecl_fn(cx.llmod, main_name, T_main_args, T_int());
1209
1210
auto llrust_start =
1211
decl_cdecl_fn(cx.llmod, "rust_start", T_rust_start_args, T_int());
0 commit comments