diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-09-20 20:33:10 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-09-20 20:33:10 +0000 |
commit | 5cbd84bb540695c7a4650bead625b9275f9f0099 (patch) | |
tree | b659bcb0e15e331604ee619dd0f709c36490277a /cpp/src/slice2freeze/Main.cpp | |
parent | Fixed ICE-7289 - forcefully close the connection when the session is gone (diff) | |
download | ice-5cbd84bb540695c7a4650bead625b9275f9f0099.tar.bz2 ice-5cbd84bb540695c7a4650bead625b9275f9f0099.tar.xz ice-5cbd84bb540695c7a4650bead625b9275f9f0099.zip |
Fixed generated include when source Slice file is in a path with symlink
Diffstat (limited to 'cpp/src/slice2freeze/Main.cpp')
-rw-r--r-- | cpp/src/slice2freeze/Main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index 449f1374eb0..8fcbf28ca00 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -1990,13 +1990,24 @@ compile(const vector<string>& argv) } else { - PreprocessorPtr icecpp = Preprocessor::create(argv[0], args[idx], cppArgs); + string sliceFile = args[idx]; + + PreprocessorPtr icecpp = Preprocessor::create(argv[0], sliceFile, cppArgs); // // Add an include file for each Slice file. Note that the .h extension // is replaced with headerExtension later. // - includes.push_back(icecpp->getBaseName() + ".h"); + + string headerFile = sliceFile; + string::size_type pos = headerFile.rfind('.'); + if(pos != string::npos) + { + headerFile.erase(pos); + } + headerFile += ".h"; + + includes.push_back(headerFile); FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2FREEZE__"); |