From b5d18a8c9c4ffa797d372ee52b1196c36730f227 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Mon, 11 Aug 2003 00:15:42 +0000 Subject: Changed conditional code generation for scoped names to only apply to VC++ 6 because VC .NET has fixed it. Got rid of incorrect comment about "<:" character sequence: that's not a compiler bug but a digraph. "<:" is the same as "[" according to the ISO C++ standard. --- cpp/src/slice2cpp/Gen.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cpp/src/slice2cpp/Gen.cpp') diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index ad7fe398cb6..d7bf4a8adba 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1078,7 +1078,7 @@ Slice::Gen::TypesVisitor::emitExceptionBase(const ExceptionPtr& base, const std: if(base) { C.zeroIndent(); - C << nl << "#ifdef _WIN32"; // COMPILERBUG + C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG C.restoreIndent(); C << nl << fixKwd(base->name()) << "::" << call << ";"; C.zeroIndent(); @@ -2151,23 +2151,23 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) string unixUpcall; if(!bases.empty() && !bases.front()->isInterface()) { - winUpcall = fixKwd(bases.front()->scoped().substr(2)) + "::__copyMembers(__p);"; + winUpcall = fixKwd(bases.front()->name()) + "::__copyMembers(__p);"; unixUpcall = fixKwd(bases.front()->scoped()) + "::__copyMembers(__p);"; } else { - winUpcall = "Ice::Object::__copyMembers(__p);"; + winUpcall = "Object::__copyMembers(__p);"; unixUpcall = "::Ice::Object::__copyMembers(__p);"; } string winCall; string unixCall; if(!dataMembers.empty()) { - winCall = scoped.substr(2) + "::__copyMembers(__p);"; + winCall = name + "::__copyMembers(__p);"; unixCall = scoped + "::__copyMembers(__p);"; } C.zeroIndent(); - C << nl << "#ifdef _WIN32"; // COMPILERBUG + C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG C.restoreIndent(); C << nl << winUpcall; if(!winCall.empty()) @@ -2325,8 +2325,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) << "::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)"; C << sb; - // COMPILERBUG: Sun C++ 5.4 and GCC 3.2 won't compile without a - // space between < and :: C << nl << "::std::pair< ::std::string*, ::std::string*> r = " << "::std::equal_range(__all, __all + " << allOpNames.size() << ", current.operation);"; C << nl << "if(r.first == r.second)"; @@ -2773,7 +2771,7 @@ Slice::Gen::ObjectVisitor::emitClassBase(const ClassDefPtr& base, const std::str string unixName = base ? fixKwd(base->scoped()) : "::Ice::Object"; C.zeroIndent(); - C << nl << "#ifdef _WIN32"; // COMPILERBUG + C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG C.restoreIndent(); C << nl << winName << "::" << call << "(" << stream << ");"; C.zeroIndent(); -- cgit v1.2.3