File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2243,17 +2243,17 @@ pub fn create_main_wrapper(ccx: @CrateContext,
22432243 }
22442244
22452245 fn create_entry_fn(ccx: @CrateContext, rust_main: ValueRef) {
2246- #[cfg(windows)]
2247- fn main_name() -> ~str { return ~" WinMain @16 "; }
2248- #[cfg(unix)]
2249- fn main_name() -> ~str { return ~" main"; }
22502246 let llfty = T_fn(~[ccx.int_type, T_ptr(T_ptr(T_i8()))], ccx.int_type);
22512247
22522248 // FIXME #4404 android JNI hacks
22532249 let llfn = if *ccx.sess.building_library {
22542250 decl_cdecl_fn(ccx.llmod, ~" amain", llfty)
22552251 } else {
2256- decl_cdecl_fn(ccx.llmod, main_name(), llfty)
2252+ let main_name = match ccx.sess.targ_cfg.os {
2253+ session::os_win32 => ~" WinMain @16 ",
2254+ _ => ~" main",
2255+ };
2256+ decl_cdecl_fn(ccx.llmod, main_name, llfty)
22572257 };
22582258 let llbb = str::as_c_str(~" top", |buf| {
22592259 unsafe {
You can’t perform that action at this time.
0 commit comments