summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2010-03-09 15:44:42 -0800
committerMark Spruiell <mes@zeroc.com>2010-03-09 15:44:42 -0800
commit73e8f0ee7975c33f5b8fad7619a7206befc21f29 (patch)
tree824d4f48707a427ff010683b2e106205100c85f7 /cpp/src/slice2cpp/Gen.cpp
parentAdjusted activation timeout to avoid IceGrid/activation test failure (diff)
downloadice-73e8f0ee7975c33f5b8fad7619a7206befc21f29.tar.bz2
ice-73e8f0ee7975c33f5b8fad7619a7206befc21f29.tar.xz
ice-73e8f0ee7975c33f5b8fad7619a7206befc21f29.zip
bug 4704 - template error in nested Slice definition
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 22355fea588..4e68b64aa84 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -6629,21 +6629,34 @@ Slice::Gen::StreamVisitor::visitModuleStart(const ModulePtr& m)
{
return false;
}
- H.zeroIndent();
- H << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERFIX
- H << nl << "#else";
- H.restoreIndent();
- H << nl << "namespace Ice" << nl << '{';
+ if(UnitPtr::dynamicCast(m->container()))
+ {
+ //
+ // Only emit this for the top-level module.
+ //
+ H << sp;
+ H.zeroIndent();
+ H << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERFIX
+ H << nl << "#else";
+ H.restoreIndent();
+ H << nl << "namespace Ice" << nl << '{';
+ }
return true;
}
void
-Slice::Gen::StreamVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::StreamVisitor::visitModuleEnd(const ModulePtr& m)
{
- H << nl << '}';
- H.zeroIndent();
- H << nl << "#endif";
- H.restoreIndent();
+ if(UnitPtr::dynamicCast(m->container()))
+ {
+ //
+ // Only emit this for the top-level module.
+ //
+ H << nl << '}';
+ H.zeroIndent();
+ H << nl << "#endif";
+ H.restoreIndent();
+ }
}
bool