From 4b640faae2b29cd8d6cb97471cd37b3ce1334cfc Mon Sep 17 00:00:00 2001 From: Matthew Newhook Date: Thu, 31 Jan 2002 15:14:28 +0000 Subject: WIN32 updates. --- cpp/src/slice2java/Gen.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'cpp/src/slice2java/Gen.cpp') diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index d4c578c163c..f2ed551fd4a 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -459,6 +459,12 @@ Slice::JavaVisitor::getArgs(const OperationPtr& op, const string& scope) return args; } +static bool +exceptionIsLocal(const ::Slice::ExceptionPtr exception) +{ + return exception->isLocal(); +} + void Slice::JavaVisitor::writeThrowsClause(const string& scope, const ExceptionList& throws) @@ -467,8 +473,13 @@ Slice::JavaVisitor::writeThrowsClause(const string& scope, // Don't include local exceptions in the throws clause // ExceptionList::size_type localCount = 0; - localCount = count_if(throws.begin(), throws.end(), - ::IceUtil::memFun(&Exception::isLocal)); + + // + // MSVC gets confused if ::IceUtil::memFun(&::Slice::Exception::isLocal)); is used + // hence the exceptionIsLocal function. + // + localCount = count_if(throws.begin(), throws.end(), exceptionIsLocal); + Output& out = output(); if (throws.size() - localCount > 0) { @@ -1164,8 +1175,11 @@ Slice::JavaVisitor::writeDispatch(Output& out, const ClassDefPtr& p) throws.sort(); throws.unique(); - remove_if(throws.begin(), throws.end(), - ::IceUtil::memFun(&Exception::isLocal)); + // + // MSVC gets confused if ::IceUtil::memFun(&::Slice::Exception::isLocal)); is used + // hence the exceptionIsLocal function. + // + remove_if(throws.begin(), throws.end(), exceptionIsLocal); if (!inParams.empty()) { @@ -3061,8 +3075,11 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) throws.sort(); throws.unique(); - remove_if(throws.begin(), throws.end(), - ::IceUtil::memFun(&Exception::isLocal)); + // + // MSVC gets confused if ::IceUtil::memFun(&::Slice::Exception::isLocal)); is used + // hence the exceptionIsLocal function. + // + remove_if(throws.begin(), throws.end(), exceptionIsLocal); string params = getParams(op, scope); -- cgit v1.2.3