diff options
author | Jose <jose@zeroc.com> | 2016-09-17 00:28:00 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-09-17 00:28:00 +0200 |
commit | 47c3b5d2b03d3286cba2a3b4890e57fdd6135132 (patch) | |
tree | 40e05ffec6df92a5b88fdb675d775580f41547c1 /cpp/src/slice2py/Main.cpp | |
parent | 3.6.3 version fixes (diff) | |
download | ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.tar.bz2 ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.tar.xz ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.zip |
Fix ICE-4787 - slice compilers and unicode paths
Diffstat (limited to 'cpp/src/slice2py/Main.cpp')
-rw-r--r-- | cpp/src/slice2py/Main.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp index ab22e73a5b0..39e103cfb4e 100644 --- a/cpp/src/slice2py/Main.cpp +++ b/cpp/src/slice2py/Main.cpp @@ -14,31 +14,35 @@ using namespace std; using namespace Slice; using namespace Slice::Python; -int -main(int argc, char* argv[]) +#ifdef _WIN32 +int wmain(int argc, wchar_t* argv[]) +#else +int main(int argc, char* argv[]) +#endif { + vector<string> args = Slice::argvToArgs(argc, argv); try { - return Slice::Python::compile(argc, argv); + return Slice::Python::compile(args); } catch(const std::exception& ex) { - getErrorStream() << argv[0] << ": error:" << ex.what() << endl; + getErrorStream() << args[0] << ": error:" << ex.what() << endl; return EXIT_FAILURE; } catch(const std::string& msg) { - getErrorStream() << argv[0] << ": error:" << msg << endl; + getErrorStream() << args[0] << ": error:" << msg << endl; return EXIT_FAILURE; } catch(const char* msg) { - getErrorStream() << argv[0] << ": error:" << msg << endl; + getErrorStream() << args[0] << ": error:" << msg << endl; return EXIT_FAILURE; } catch(...) { - getErrorStream() << argv[0] << ": error:" << "unknown exception" << endl; + getErrorStream() << args[0] << ": error:" << "unknown exception" << endl; return EXIT_FAILURE; } } |