diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-09-10 08:49:45 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-09-10 08:49:45 +0200 |
commit | 981d2ac7c8f825f92670f9121a7d29edd94da6f9 (patch) | |
tree | 286f13f365513c9894c0ec4167b8bbef30965bf9 /cpp/src/slice2cpp/Gen.cpp | |
parent | Fixed communicator flushBatchRequests to allow tracing (diff) | |
parent | Fixed ICE-4863 (IceProxy::Ice::Object derives privately from Mutex) + a few w... (diff) | |
download | ice-981d2ac7c8f825f92670f9121a7d29edd94da6f9.tar.bz2 ice-981d2ac7c8f825f92670f9121a7d29edd94da6f9.tar.xz ice-981d2ac7c8f825f92670f9121a7d29edd94da6f9.zip |
Merge remote-tracking branch 'origin/encoding11' into withoutsync
Conflicts:
cpp/src/Ice/PropertyNames.cpp
cpp/src/Ice/PropertyNames.h
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 53ef4dea799..3a2f2a2b4d1 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -214,12 +214,12 @@ Slice::Gen::Gen(const string& base, const string& headerExtension, const string& Slice::Gen::~Gen() { - H << '\n'; + H << "\n\n#endif\n"; C << '\n'; if(_impl) { - implH << '\n'; + implH << "\n\n#endif\n"; implC << '\n'; } } @@ -280,7 +280,15 @@ Slice::Gen::generate(const UnitPtr& p) } FileTracker::instance()->addFile(fileImplC); - implH << "#pragma once\n"; + string s = fileImplH; + if(_include.size()) + { + s = _include + '/' + s; + } + transform(s.begin(), s.end(), s.begin(), ToIfdef()); + implH << "#ifndef __" << s << "__"; + implH << "\n#define __" << s << "__"; + implH << '\n'; } string fileH = _base + "." + _headerExtension; @@ -314,7 +322,16 @@ Slice::Gen::generate(const UnitPtr& p) printHeader(C); printGeneratedHeader(C, _base + ".ice"); - H << "#pragma once\n"; + + string s = fileH; + if(_include.size()) + { + s = _include + '/' + s; + } + transform(s.begin(), s.end(), s.begin(), ToIfdef()); + H << "\n#ifndef __" << s << "__"; + H << "\n#define __" << s << "__"; + H << '\n'; validateMetaData(p); |