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/Slice/Util.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/Slice/Util.cpp')
-rw-r--r-- | cpp/src/Slice/Util.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp index 66d142b5897..80d3a9247f2 100644 --- a/cpp/src/Slice/Util.cpp +++ b/cpp/src/Slice/Util.cpp @@ -10,6 +10,7 @@ #include <Slice/Util.h> #include <IceUtil/FileUtil.h> #include <IceUtil/StringUtil.h> +#include <IceUtil/StringConverter.h> #include <climits> #ifndef _MSC_VER @@ -172,11 +173,11 @@ Slice::changeInclude(const string& path, const vector<string>& includePaths) { paths.push_back(canonicalPath); } - + for(vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) { for(vector<string>::const_iterator j = includePaths.begin(); j != includePaths.end(); ++j) - { + { if(i->compare(0, j->length(), *j) == 0) { string s = i->substr(j->length() + 1); // + 1 for the '/' @@ -186,7 +187,7 @@ Slice::changeInclude(const string& path, const vector<string>& includePaths) } } } - + // // If the path has been already shortened no need to test // with canonical path. @@ -430,3 +431,27 @@ Slice::DependOutputUtil::os() { return _file.empty() ? cout : _os; } + +#ifdef _WIN32 +vector<string> +Slice::argvToArgs(int argc, wchar_t* argv[]) +{ + vector<string> args; + for(int i = 0; i < argc; i++) + { + args.push_back(IceUtil::wstringToString(argv[i])); + } + return args; +} +#else +vector<string> +Slice::argvToArgs(int argc, char* argv[]) +{ + vector<string> args; + for(int i = 0; i < argc; i++) + { + args.push_back(argv[i]); + } + return args; +} +#endif |