diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-28 15:02:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-28 15:02:03 +0100 |
commit | c8bd13216c537a811dc6b770b2d6631ed230ee2c (patch) | |
tree | 74d96ecfff05197bbe8df59335e6f276745e7641 /cpp/src | |
parent | ICE-5792 fixed IceGridGUI install (diff) | |
download | ice-c8bd13216c537a811dc6b770b2d6631ed230ee2c.tar.bz2 ice-c8bd13216c537a811dc6b770b2d6631ed230ee2c.tar.xz ice-c8bd13216c537a811dc6b770b2d6631ed230ee2c.zip |
Fixed ICE-5548: fixed C++11 support to maintain binary compatibility between C++11 and C++03 compiled code
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.h | 3 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.h | 3 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 12 |
5 files changed, 15 insertions, 18 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index a7c2aee35d2..9a48b60d55b 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -221,11 +221,11 @@ Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBa return __begin_flushBatchRequests(cb, cookie); } -#ifdef ICE_CPP11 AsyncResultPtr Ice::CommunicatorI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, const IceInternal::Function<void (bool)>& sent) { +#ifdef ICE_CPP11 class Cpp11CB : public IceInternal::Cpp11FnCallbackNC { @@ -256,8 +256,11 @@ Ice::CommunicatorI::begin_flushBatchRequests(const IceInternal::Function<void (c }; return __begin_flushBatchRequests(new Cpp11CB(exception, sent), 0); -} +#else + assert(false); // Ice not built with C++11 support. + return 0; #endif +} namespace { diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 91fdb0ccfc3..58c9da5cd7b 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -65,11 +65,10 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Communicator_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); -#ifdef ICE_CPP11 + virtual AsyncResultPtr begin_flushBatchRequests( const IceInternal::Function<void (const Exception&)>&, const IceInternal::Function<void (bool)>& = IceInternal::Function<void (bool)>()); -#endif virtual void end_flushBatchRequests(const AsyncResultPtr&); diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index eb2a03cfc34..8da88c6842e 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -993,12 +993,11 @@ Ice::ConnectionI::begin_flushBatchRequests(const Callback_Connection_flushBatchR return __begin_flushBatchRequests(cb, cookie); } -#ifdef ICE_CPP11 AsyncResultPtr Ice::ConnectionI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, const IceInternal::Function<void (bool)>& sent) { - +#ifdef ICE_CPP11 class Cpp11CB : public IceInternal::Cpp11FnCallbackNC { public: @@ -1028,8 +1027,11 @@ Ice::ConnectionI::begin_flushBatchRequests(const IceInternal::Function<void (con }; return __begin_flushBatchRequests(new Cpp11CB(exception, sent), 0); +#else + assert(false); // Ice not built with C++11 support. + return 0; +#endif } -#endif AsyncResultPtr Ice::ConnectionI::__begin_flushBatchRequests(const CallbackBasePtr& cb, const LocalObjectPtr& cookie) diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 6ed4618eed7..0542741e49b 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -171,11 +171,10 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Connection_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); -#ifdef ICE_CPP11 + virtual AsyncResultPtr begin_flushBatchRequests( const ::IceInternal::Function<void (const ::Ice::Exception&)>&, const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); -#endif virtual void end_flushBatchRequests(const AsyncResultPtr&); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 57f3337c06f..7b195708399 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3664,17 +3664,11 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) } } - H.zeroIndent(); - H << nl << "#ifdef ICE_CPP11"; - H.restoreIndent(); - + H << nl << "// Only supported with C++ 11 support enabled"; H << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception" - << "const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()" << epar << " = 0;"; - - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); + << "const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()" + << epar << " = 0;"; H << sp << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << epar << " = 0;"; |