rustc: Use "main" entry point on Windows

Fixes #8510.
This commit is contained in:
klutzy 2013-08-28 13:43:11 +09:00
parent 35f975b838
commit eaa565829d

View File

@ -2366,20 +2366,12 @@ fn create_entry_fn(ccx: @mut CrateContext,
&ccx.int_type);
// FIXME #4404 android JNI hacks
let llfn = if *ccx.sess.building_library {
decl_cdecl_fn(ccx.llmod, "amain", llfty)
let main_name = if *ccx.sess.building_library {
"amain"
} else {
let main_name = match ccx.sess.targ_cfg.os {
session::os_win32 => {
match ccx.sess.targ_cfg.arch {
X86 => ~"WinMain@16",
_ => ~"WinMain",
}
},
_ => ~"main",
};
decl_cdecl_fn(ccx.llmod, main_name, llfty)
"main"
};
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
let llbb = do "top".with_c_str |buf| {
unsafe {
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)