diff --git a/modules/ca/src/client/ca_client_context.cpp b/modules/ca/src/client/ca_client_context.cpp index 907a7cefa..1c2f985b5 100644 --- a/modules/ca/src/client/ca_client_context.cpp +++ b/modules/ca/src/client/ca_client_context.cpp @@ -153,13 +153,13 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) : this->localPort = htons ( tmpAddr.ia.sin_port ); } - std::auto_ptr < CallbackGuard > pCBGuard; + ca::auto_ptr < CallbackGuard > pCBGuard; if ( ! enablePreemptiveCallback ) { pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) ); } // multiple steps ensure exception safety - this->pCallbackGuard = pCBGuard; + this->pCallbackGuard = PTRMOVE(pCBGuard); } ca_client_context::~ca_client_context () diff --git a/modules/ca/src/client/oldAccess.h b/modules/ca/src/client/oldAccess.h index e8c4f6948..cace26ec1 100644 --- a/modules/ca/src/client/oldAccess.h +++ b/modules/ca/src/client/oldAccess.h @@ -38,6 +38,17 @@ #include "cadef.h" #include "syncGroup.h" +namespace ca { +#if __cplusplus>=201103L +template +using auto_ptr = std::unique_ptr; +#define PTRMOVE(AUTO) std::move(AUTO) +#else +using std::auto_ptr; +#define PTRMOVE(AUTO) (AUTO) +#endif +} + struct oldChannelNotify : private cacChannelNotify { public: oldChannelNotify ( @@ -393,8 +404,8 @@ private: epicsEvent ioDone; epicsEvent callbackThreadActivityComplete; epicsThreadId createdByThread; - std::auto_ptr < CallbackGuard > pCallbackGuard; - std::auto_ptr < cacContext > pServiceContext; + ca::auto_ptr < CallbackGuard > pCallbackGuard; + ca::auto_ptr < cacContext > pServiceContext; caExceptionHandler * ca_exception_func; void * ca_exception_arg; caPrintfFunc * pVPrintfFunc; diff --git a/modules/ca/src/client/udpiiu.h b/modules/ca/src/client/udpiiu.h index d579bac00..aba79be5d 100644 --- a/modules/ca/src/client/udpiiu.h +++ b/modules/ca/src/client/udpiiu.h @@ -40,6 +40,17 @@ #include "repeaterSubscribeTimer.h" #include "SearchDest.h" +namespace ca { +#if __cplusplus>=201103L +template +using auto_ptr = std::unique_ptr; +#define PTRMOVE(AUTO) std::move(AUTO) +#else +using std::auto_ptr; +#define PTRMOVE(AUTO) (AUTO) +#endif +} + extern "C" void cacRecvThreadUDP ( void *pParam ); LIBCA_API void epicsStdCall caStartRepeaterIfNotInstalled ( @@ -161,7 +172,7 @@ private: epicsMutex & cacMutex; const unsigned nTimers; struct SearchArray { - typedef std::auto_ptr value_type; + typedef ca::auto_ptr value_type; value_type *arr; SearchArray(size_t n) : arr(new value_type[n]) {} ~SearchArray() { delete[] arr; } diff --git a/modules/database/src/ioc/db/dbCAC.h b/modules/database/src/ioc/db/dbCAC.h index b0775016e..ab4018139 100644 --- a/modules/database/src/ioc/db/dbCAC.h +++ b/modules/database/src/ioc/db/dbCAC.h @@ -48,6 +48,17 @@ #include "db_convert.h" #include "resourceLib.h" +namespace ca { +#if __cplusplus>=201103L +template +using auto_ptr = std::unique_ptr; +#define PTRMOVE(AUTO) std::move(AUTO) +#else +using std::auto_ptr; +#define PTRMOVE(AUTO) (AUTO) +#endif +} + extern "C" int putNotifyPut ( processNotify *ppn, notifyPutType notifyPutType ); extern "C" void putNotifyCompletion ( processNotify *ppn ); @@ -194,7 +205,7 @@ private: epicsMutex & mutex; epicsMutex & cbMutex; cacContextNotify & notify; - std::auto_ptr < cacContext > pNetContext; + ca::auto_ptr < cacContext > pNetContext; char * pStateNotifyCache; bool isolated; diff --git a/modules/database/src/ioc/db/dbContext.cpp b/modules/database/src/ioc/db/dbContext.cpp index 4bd96d3b4..4dea545dd 100644 --- a/modules/database/src/ioc/db/dbContext.cpp +++ b/modules/database/src/ioc/db/dbContext.cpp @@ -71,7 +71,7 @@ dbContext::dbContext ( epicsMutex & cbMutexIn, epicsMutex & mutexIn, cacContextNotify & notifyIn ) : readNotifyCache ( mutexIn ), ctx ( 0 ), stateNotifyCacheSize ( 0 ), mutex ( mutexIn ), cbMutex ( cbMutexIn ), - notify ( notifyIn ), pNetContext ( 0 ), pStateNotifyCache ( 0 ), + notify ( notifyIn ), pStateNotifyCache ( 0 ), isolated(dbServiceIsolate) { }