summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-08-06 10:24:57 +0200
committerBenoit Foucher <benoit@zeroc.com>2012-08-06 10:24:57 +0200
commite6f5dc2c89eda44fb0a3d444223131a31867a1b2 (patch)
treeb6bddfe0a0cccef45484314f47967d95a01472bb /cpp/src/slice2cpp/Gen.cpp
parentmore Java changes & tests (diff)
parentICE-4804 - Properties and case-mismatch (diff)
downloadice-e6f5dc2c89eda44fb0a3d444223131a31867a1b2.tar.bz2
ice-e6f5dc2c89eda44fb0a3d444223131a31867a1b2.tar.xz
ice-e6f5dc2c89eda44fb0a3d444223131a31867a1b2.zip
Merge remote-tracking branch 'origin/master' into encoding11
Conflicts: cpp/include/Ice/Stream.h cpp/include/Slice/Preprocessor.h rb/ruby/Makefile.mak
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp37
1 files changed, 4 insertions, 33 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index fd34162a680..44e4b501637 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\n#endif\n";
+ H << '\n';
C << '\n';
if(_impl)
{
- implH << "\n\n#endif\n";
+ implH << '\n';
implC << '\n';
}
}
@@ -280,15 +280,7 @@ Slice::Gen::generate(const UnitPtr& p)
}
FileTracker::instance()->addFile(fileImplC);
- 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';
+ implH << "#pragma once\n";
}
string fileH = _base + "." + _headerExtension;
@@ -322,16 +314,7 @@ Slice::Gen::generate(const UnitPtr& p)
printHeader(C);
printGeneratedHeader(C, _base + ".ice");
-
- 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';
+ H << "#pragma once\n";
validateMetaData(p);
@@ -6045,18 +6028,6 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
H << nl << "// COMPILERFIX: The using directive avoid compiler warnings with -Woverloaded-virtual";
H << nl << "using ::IceInternal::IncomingAsync::ice_exception;";
H << nl << "virtual void ice_exception(const ::std::exception&);";
-
- H.zeroIndent();
- H << nl << "#if defined(__BCPLUSPLUS__)";
- H.restoreIndent();
- H << nl << "// COMPILERFIX: Avoid compiler warnings with C++Builder 2010";
- H << nl << "virtual void ice_exception()";
- H << sb;
- H << nl << "::IceInternal::IncomingAsync::ice_exception();";
- H << eb;
- H.zeroIndent();
- H << nl << "#endif";
- H.restoreIndent();
}
H << eb << ';';