summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-06-22 13:45:53 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2018-06-22 13:45:53 +0200
commitded09ee554a5fb49fb246f9177c697fbea8c2719 (patch)
tree756dd684c2c5ebfc6b9a393552ff9aeee1acf11e
parent720ab6a2f37514830b7fce2aba179a1cf67016e9 (diff)
downloadATCD-ded09ee554a5fb49fb246f9177c697fbea8c2719.tar.gz
When we have C++11 we are using std::unique_ptr instead of std::auto_ptr
* ACE/ace/Auto_Ptr.cpp: * ACE/ace/WFMO_Reactor.cpp:
-rw-r--r--ACE/ace/Auto_Ptr.cpp2
-rw-r--r--ACE/ace/WFMO_Reactor.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/ACE/ace/Auto_Ptr.cpp b/ACE/ace/Auto_Ptr.cpp
index 5a1184ea3e2..09028186a67 100644
--- a/ACE/ace/Auto_Ptr.cpp
+++ b/ACE/ace/Auto_Ptr.cpp
@@ -11,8 +11,6 @@
#include "ace/Auto_Ptr.inl"
#endif /* __ACE_INLINE__ */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Ptr)
diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp
index f2c103d1c03..5f901b14108 100644
--- a/ACE/ace/WFMO_Reactor.cpp
+++ b/ACE/ace/WFMO_Reactor.cpp
@@ -1384,7 +1384,11 @@ ACE_WFMO_Reactor::register_handler_i (ACE_HANDLE event_handle,
long new_network_events = 0;
bool delete_event = false;
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr <ACE_Auto_Event> event;
+#else
auto_ptr <ACE_Auto_Event> event;
+#endif /* ACE_HAS_CPP11 */
// Look up the repository to see if the <event_handler> is already
// there.
@@ -1401,10 +1405,15 @@ ACE_WFMO_Reactor::register_handler_i (ACE_HANDLE event_handle,
// need to create one
if (event_handle == ACE_INVALID_HANDLE)
{
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<ACE_Auto_Event> tmp (new ACE_Auto_Event);
+ event = std::move(tmp);
+#else
// Note: don't change this since some C++ compilers have
// <auto_ptr>s that don't work properly...
auto_ptr<ACE_Auto_Event> tmp (new ACE_Auto_Event);
event = tmp;
+#endif /* ACE_HAS_CPP11 */
event_handle = event->handle ();
delete_event = true;
}