From a463c0ec69b7cdefc26277ec5f3b36def7b7f70e Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 20 Aug 2017 21:00:14 +0800 Subject: Codegen C - Fix a few bugs with MSVC mode --- src/trans/codegen_c.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index 23d02531..b7c3806a 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -499,7 +499,9 @@ namespace { break; case Compiler::Msvc: is_windows = true; + // TODO: Look up these paths in the registry and use CreateProcess instead of system args.push_back(cache_str( detect_msvc().path_vcvarsall )); + //args.push_back("amd64"); args.push_back("&"); args.push_back("cl.exe"); args.push_back("/nologo"); @@ -568,8 +570,9 @@ namespace { } //DEBUG("- " << cmd_ss.str()); ::std::cout << "Running comamnd - " << cmd_ss.str() << ::std::endl; - if( system(cmd_ss.str().c_str()) ) + if( system(cmd_ss.str().c_str()) != 0 ) { + ::std::cerr << "C Compiler failed to execute" << ::std::endl; abort(); } } @@ -3010,6 +3013,7 @@ namespace { m_of << ", "<