diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-04-21 17:58:38 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-04-21 17:58:38 +0200 |
commit | 094286e06f0ff154f20fcccce0c71068a3d216d5 (patch) | |
tree | 606797928608baa057fe9a9ea096622e0eb37930 /cpp/src/Slice/CPlusPlusUtil.cpp | |
parent | Fixed potential IceUtil::NullHandleException (diff) | |
download | ice-094286e06f0ff154f20fcccce0c71068a3d216d5.tar.bz2 ice-094286e06f0ff154f20fcccce0c71068a3d216d5.tar.xz ice-094286e06f0ff154f20fcccce0c71068a3d216d5.zip |
Fixed bug 3011
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index fe2cf463b3a..bb6e5db83b4 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -35,77 +35,6 @@ Slice::ToIfdef::operator()(char c) } } -string -Slice::changeInclude(const string& orig, const vector<string>& includePaths) -{ - string::size_type pos; - string cwd = getCwd(); - string file = orig; - if(!isAbsolute(file)) - { - file = cwd + "/" + file; - } - file = normalizePath(file, true); - - // - // Modify the list of include paths to be absolute paths, with and - // without symlinks resolved. - // - vector<string> newIncludePaths; - vector<string>::const_iterator p; - for(p = includePaths.begin(); p != includePaths.end(); ++p) - { - string includePath = *p; - if(!isAbsolute(includePath)) - { - includePath = cwd + "/" + includePath; - } - newIncludePaths.push_back(normalizePath(includePath, true)); - -#ifndef _WIN32 - // - // We need to get the real path name of the include directory in case - // it is a symlink, since the preprocessor output contains real path names. - // - int fd = open(".", O_RDONLY); - if(fd != -1) - { - if (!chdir(includePath.c_str())) - { - includePath = getCwd() + "/"; - fchdir(fd); - } - close(fd); - } - newIncludePaths.push_back(normalizePath(includePath, true)); -#endif - } - - // - // Compare each include path against the included file and select - // the path that produces the shortest relative filename. - // - string result = file; - for(p = newIncludePaths.begin(); p != newIncludePaths.end(); ++p) - { - string includePath = *p; - if(file.compare(0, includePath.length(), includePath) == 0) - { - string s = file.substr(includePath.length()); - if(s.size() < result.size()) - { - result = s; - } - } - } - - if((pos = result.rfind('.')) != string::npos) - { - result.erase(pos); - } - - return result; -} void Slice::printHeader(Output& out) |