diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-06-22 15:30:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 15:30:23 +0200 |
commit | 1e957f1a2ec8bc811ec8f226d18d0590bc466e33 (patch) | |
tree | 730ca902ffdb628434992d7a7ce869de3774eeb0 /ACE | |
parent | 937920d688e2131b3e77d81b659e35db84c54ca4 (diff) | |
parent | ded09ee554a5fb49fb246f9177c697fbea8c2719 (diff) | |
download | ATCD-1e957f1a2ec8bc811ec8f226d18d0590bc466e33.tar.gz |
Merge pull request #642 from jwillemsen/jwi-msvc141-cppcomplianceautoptr
When using Visual Studio 2017 we can enable C++14 and C++17 complianc…
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ace/Auto_Ptr.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Auto_Ptr.h | 2 | ||||
-rw-r--r-- | ACE/ace/WFMO_Reactor.cpp | 9 | ||||
-rw-r--r-- | ACE/ace/config-win32-msvc-141.h | 8 |
4 files changed, 19 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/Auto_Ptr.h b/ACE/ace/Auto_Ptr.h index e06eb21b4a8..ad71242e978 100644 --- a/ACE/ace/Auto_Ptr.h +++ b/ACE/ace/Auto_Ptr.h @@ -76,7 +76,9 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include <memory> #if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) +#if !defined (ACE_HAS_CPP17) using std::auto_ptr; +#endif /* !ACE_HAS_CPP17 */ #endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ #else /* ACE_HAS_STANDARD_CPP_LIBRARY */ 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; } diff --git a/ACE/ace/config-win32-msvc-141.h b/ACE/ace/config-win32-msvc-141.h index 330df3e56f7..c6376395d13 100644 --- a/ACE/ace/config-win32-msvc-141.h +++ b/ACE/ace/config-win32-msvc-141.h @@ -25,5 +25,13 @@ #include "ace/config-win32-msvc-14.h" +#if _MSVC_LANG >= 201402L +# define ACE_HAS_CPP14 +#endif /* _MSVC_LANG >= 201402L */ + +#if _MSVC_LANG >= 201703L +# define ACE_HAS_CPP17 +#endif /* _MSVC_LANG >= 201703L */ + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_141_H */ |