Skip to content

Commit 9708ef0

Browse files
committed
auto merge of #8806 : klutzy/rust/winmain, r=cmr
Fixes #8510.
2 parents 9bfdd42 + eaa5658 commit 9708ef0

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/librustc/middle/trans/base.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -2366,20 +2366,12 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23662366
&ccx.int_type);
23672367

23682368
// FIXME #4404 android JNI hacks
2369-
let llfn = if *ccx.sess.building_library {
2370-
decl_cdecl_fn(ccx.llmod, "amain", llfty)
2369+
let main_name = if *ccx.sess.building_library {
2370+
"amain"
23712371
} else {
2372-
let main_name = match ccx.sess.targ_cfg.os {
2373-
session::os_win32 => {
2374-
match ccx.sess.targ_cfg.arch {
2375-
X86 => ~"WinMain@16",
2376-
_ => ~"WinMain",
2377-
}
2378-
},
2379-
_ => ~"main",
2380-
};
2381-
decl_cdecl_fn(ccx.llmod, main_name, llfty)
2372+
"main"
23822373
};
2374+
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
23832375
let llbb = do "top".with_c_str |buf| {
23842376
unsafe {
23852377
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)

0 commit comments

Comments
 (0)