diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/Make.rules | 3 | ||||
-rw-r--r-- | cpp/config/Make.rules.Darwin | 4 | ||||
-rw-r--r-- | cpp/config/Make.rules.FreeBSD | 2 | ||||
-rw-r--r-- | cpp/config/Make.rules.Linux | 4 | ||||
-rw-r--r-- | cpp/src/Glacier2Lib/Application.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Glacier2Lib/SessionHelper.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerAdminI.cpp | 10 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 3 | ||||
-rw-r--r-- | cpp/src/IceLocatorDiscovery/PluginI.cpp | 5 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/acm/AllTests.cpp | 5 | ||||
-rw-r--r-- | cpp/test/Ice/hold/AllTests.cpp | 6 |
13 files changed, 30 insertions, 22 deletions
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index cff386804a2..59a243de23f 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -170,7 +170,6 @@ ifneq ($(shell test "$(USE_BIN_DIST)" != "yes" -a -d $(top_srcdir)/../$(ice_lang endif ifeq ($(CPP11_MAPPING),yes) - CPP11 = yes CPPFLAGS += -DICE_CPP11_MAPPING endif @@ -297,7 +296,7 @@ SLICE2CPPFLAGS = $(ICECPPFLAGS) ifeq ($(ice_dir), $(usr_dir)) LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) - ifeq ($(CPP11),yes) + ifeq ($(CPP11_MAPPING),yes) LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)$(cpp11libdirsuffix) endif else diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin index c312a122e20..35b8c2cd92c 100644 --- a/cpp/config/Make.rules.Darwin +++ b/cpp/config/Make.rules.Darwin @@ -40,8 +40,8 @@ endif # On OS X, always build with C++11 support enabled unless we # explicitly set it to no (possibly to test binary compatibility). # -ifneq ($(CPP11), no) - CPPFLAGS += --std=c++1y +ifneq ($(CPP11_MAPPING), no) + CPPFLAGS += --std=c++11 endif # diff --git a/cpp/config/Make.rules.FreeBSD b/cpp/config/Make.rules.FreeBSD index f65a707bf8a..ee2583040ec 100644 --- a/cpp/config/Make.rules.FreeBSD +++ b/cpp/config/Make.rules.FreeBSD @@ -33,7 +33,7 @@ else endif -ifeq ($(CPP11), yes) +ifeq ($(CPP11_MAPPING), yes) CPPFLAGS += --std=c++11 CXXFLAGS += --stdlib=libc++ endif diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux index 100febf6560..9407bb52efc 100644 --- a/cpp/config/Make.rules.Linux +++ b/cpp/config/Make.rules.Linux @@ -45,8 +45,8 @@ ifeq ($(GCC_COMPILER),yes) CXXARCHFLAGS += -march=i586 endif - ifeq ($(CPP11), yes) - CXXFLAGS += -std=c++1y + ifeq ($(CPP11_MAPPING), yes) + CXXFLAGS += -std=c++11 endif ifeq ($(MACHINE),sparc64) diff --git a/cpp/src/Glacier2Lib/Application.cpp b/cpp/src/Glacier2Lib/Application.cpp index 24e6c35afc2..b8edf35c07c 100644 --- a/cpp/src/Glacier2Lib/Application.cpp +++ b/cpp/src/Glacier2Lib/Application.cpp @@ -200,8 +200,9 @@ Glacier2::Application::doMain(Ice::StringSeq& args, const Ice::InitializationDat assert(connection); connection->setACM(acmTimeout, IceUtil::None, Ice::HeartbeatAlways); #ifdef ICE_CPP11_MAPPING + auto self = weak_from_this(); connection->setCloseCallback( - [self = weak_from_this()](Ice::ConnectionPtr) + [self](Ice::ConnectionPtr) { auto s = self.lock(); if(s) diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index 2aebb4cfc30..1b1a630d3af 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -805,7 +805,8 @@ SessionHelperI::connected(const Glacier2::RouterPrxPtr& router, const Glacier2:: assert(connection); connection->setACM(acmTimeout, IceUtil::None, Ice::HeartbeatAlways); #ifdef ICE_CPP11_MAPPING - connection->setCloseCallback([self = shared_from_this()](Ice::ConnectionPtr) + auto self = shared_from_this(); + connection->setCloseCallback([self](Ice::ConnectionPtr) { self->destroy(); }); diff --git a/cpp/src/Ice/LoggerAdminI.cpp b/cpp/src/Ice/LoggerAdminI.cpp index 113283a8d77..a7587c238e6 100644 --- a/cpp/src/Ice/LoggerAdminI.cpp +++ b/cpp/src/Ice/LoggerAdminI.cpp @@ -415,8 +415,9 @@ LoggerAdminI::attachRemoteLogger(const RemoteLoggerPrx& prx, #ifdef ICE_CPP11_MAPPING try { + auto self = shared_from_this(); remoteLogger->init_async(logger->getPrefix(), initLogMessages, - [self = shared_from_this(), logger, remoteLogger]() + [self, logger, remoteLogger]() { if(self->_traceLevel > 1) { @@ -424,7 +425,7 @@ LoggerAdminI::attachRemoteLogger(const RemoteLoggerPrx& prx, trace << "init on `" << remoteLogger << "' completed successfully"; } }, - [self = shared_from_this(), logger, remoteLogger](exception_ptr e) + [self, logger, remoteLogger](exception_ptr e) { try { @@ -853,8 +854,9 @@ LoggerAdminLoggerI::run() { #ifdef ICE_CPP11_MAPPING RemoteLoggerPrxPtr remoteLogger = *p; + auto self = shared_from_this(); remoteLogger->log_async(job->logMessage, - [self = shared_from_this(), remoteLogger]() + [self, remoteLogger]() { if(self->_loggerAdmin->getTraceLevel() > 1) { @@ -862,7 +864,7 @@ LoggerAdminLoggerI::run() trace << "log on `" << remoteLogger << "' completed successfully"; } }, - [self = shared_from_this(), remoteLogger](exception_ptr e) + [self, remoteLogger](exception_ptr e) { try { diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 0c43fb40aa3..895fbced78b 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -97,7 +97,7 @@ Ice::ObjectPrx::ice_isA_async(const string& typeId, os->write(typeId); }, false, - [response = move(response)](IceInternal::BasicStream* is) + [response](IceInternal::BasicStream* is) { bool ret; is->read(ret); diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 27f7eb5db94..9577561652d 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -913,7 +913,8 @@ IceBox::ServiceManagerI::stopAll() function<void (exception_ptr)> IceBox::ServiceManagerI::makeObserverCompletedCallback(const shared_ptr<ServiceObserverPrx>& observer) { - return [self = weak_from_this(), observer](exception_ptr ex) + auto self = weak_from_this(); + return [self, observer](exception_ptr ex) { auto s = self.lock(); if(s) diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index 4ca7b6ec35e..e96e62dfca6 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -370,8 +370,9 @@ Request::invoke(const Ice::LocatorPrxPtr& l) _locatorPrx = l; try { + auto self = shared_from_this(); l->ice_invoke_async(_operation, _mode, _inParams, - [self = shared_from_this()](bool ok, vector<Ice::Byte> outParams) + [self](bool ok, vector<Ice::Byte> outParams) { pair<const Ice::Byte*, const Ice::Byte*> outPair; if(outParams.empty()) @@ -385,7 +386,7 @@ Request::invoke(const Ice::LocatorPrxPtr& l) } self->response(ok, move(outPair)); }, - [self = shared_from_this()](exception_ptr e) + [self](exception_ptr e) { try { diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index f390ce4ce13..76d950bc097 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -6557,7 +6557,7 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) if(ret || !outParams.empty()) { C << nl << "false" << ","; - C << nl << "[__response = ::std::move(__response)](::IceInternal::BasicStream* __is)"; + C << nl << "[__response](::IceInternal::BasicStream* __is)"; C << sb; writeAllocateCode(C, outParams, p, true, _useWstring | TypeContextAMIEnd | TypeContextReadClosure, true); writeUnmarshalCode(C, outParams, p, true, _useWstring | TypeContextAMIEnd); diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index 6223d4240ad..5fb112df140 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -199,13 +199,14 @@ public: try { #ifdef ICE_CPP11_MAPPING + auto self = shared_from_this(); proxy->ice_getConnection()->setCloseCallback( - [self = shared_from_this()](Ice::ConnectionPtr connection) + [self](Ice::ConnectionPtr connection) { self->closed(move(connection)); }); proxy->ice_getConnection()->setHeartbeatCallback( - [self = shared_from_this()](Ice::ConnectionPtr connection) + [self](Ice::ConnectionPtr connection) { self->heartbeat(move(connection)); }); diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index 621ec2763af..c2ebab5cd87 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -137,8 +137,9 @@ allTests(const Ice::CommunicatorPtr& communicator) { completed = make_shared<promise<void>>(); promise<bool> sent; + auto expected = value; hold->set_async(value + 1, IceUtilInternal::random(5), - [cond, expected = value, completed](int value) + [cond, expected, completed](int value) { if(value != expected) { @@ -209,10 +210,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { completed = make_shared<promise<void>>(); promise<bool> sent; + auto expected = value; holdSerialized->set_async( value + 1, IceUtilInternal::random(1), - [cond, expected = value, completed](int value) + [cond, expected, completed](int value) { if(value != expected) { |