diff options
Diffstat (limited to '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__"); |