From 62f9ccfd51f985db0539d9af7030c0461bb23008 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 9 Aug 2012 10:20:56 +0200 Subject: Fix --- cpp/src/slice2cpp/Gen.cpp | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'cpp/src/slice2cpp/Gen.cpp') diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index d7b20bc1235..00bc50a0512 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -335,20 +335,17 @@ Slice::Gen::generate(const UnitPtr& p) C << _base << "." << _headerExtension << ">"; - H << "\n#include "; H << "\n#include "; H << "\n#include "; H << "\n#include "; H << "\n#include "; H << "\n#include "; - - if(p->usesProxies()) - { - H << "\n#include "; - } + H << "\n#include "; + H << "\n#include "; if(p->hasNonLocalClassDefs()) { + H << "\n#include "; H << "\n#include "; H << "\n#include "; H << "\n#include "; @@ -362,19 +359,11 @@ Slice::Gen::generate(const UnitPtr& p) C << "\n#include "; C << "\n#include "; } - else if(p->hasNonLocalClassDecls()) - { - - H << "\n#include "; - } if(p->hasNonLocalDataOnlyClasses() || p->hasNonLocalExceptions()) { H << "\n#include "; } - - H << "\n#include "; - H << "\n#include "; if(p->usesNonLocals()) { @@ -6189,16 +6178,19 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p) void Slice::Gen::StreamVisitor::visitEnum(const EnumPtr& p) { - string scoped = fixKwd(p->scoped()); - H << nl << "template<>"; - H << nl << "struct StreamTrait< " << scoped << ">"; - H << sb; - H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeEnum;"; - H << nl << "static const int enumLimit = " << p->getEnumerators().size() << ";"; - H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; - H << nl << "static const bool isVariableLength = true;"; - H << nl << "static const ::Ice::OptionalType optionalType = ::Ice::OptionalTypeSize;"; - H << eb << ";" << nl; + if(!p->isLocal()) + { + string scoped = fixKwd(p->scoped()); + H << nl << "template<>"; + H << nl << "struct StreamTrait< " << scoped << ">"; + H << sb; + H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeEnum;"; + H << nl << "static const int enumLimit = " << p->getEnumerators().size() << ";"; + H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; + H << nl << "static const bool isVariableLength = true;"; + H << nl << "static const ::Ice::OptionalType optionalType = ::Ice::OptionalTypeSize;"; + H << eb << ";" << nl; + } } void -- cgit v1.2.3