diff options
Diffstat (limited to 'ACE/ace')
-rw-r--r-- | ACE/ace/Dev_Poll_Reactor.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Event_Handler.h | 30 | ||||
-rw-r--r-- | ACE/ace/Get_Opt.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/MMAP_Memory_Pool.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/OS_NS_stdio.inl | 16 | ||||
-rw-r--r-- | ACE/ace/SOCK_Dgram_Bcast.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Select_Reactor_Base.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Sock_Connect.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/WFMO_Reactor.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/config-win32-msvc-14.h | 10 |
11 files changed, 47 insertions, 25 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp index 9dc4bc1f111..a9adbdd460d 100644 --- a/ACE/ace/Dev_Poll_Reactor.cpp +++ b/ACE/ace/Dev_Poll_Reactor.cpp @@ -2284,7 +2284,7 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, { case ACE_Reactor::GET_MASK: // The work for this operation is done in all cases at the - // begining of the function. + // beginning of the function. return old_mask; case ACE_Reactor::CLR_MASK: diff --git a/ACE/ace/Event_Handler.h b/ACE/ace/Event_Handler.h index 7f2a26f5db5..88524608cda 100644 --- a/ACE/ace/Event_Handler.h +++ b/ACE/ace/Event_Handler.h @@ -316,9 +316,7 @@ private: */ class ACE_Export ACE_Event_Handler_var { - public: - /// Default constructor. ACE_Event_Handler_var (void); @@ -355,10 +353,36 @@ private: ACE_Event_Handler *ptr_; }; +#if defined ACE_HAS_CPP11 + +namespace ACE +{ + /// With C++11 it is common to not use C++ new and delete, but + /// use std::make_shared and std::make_unique. This will not + /// work for ACE event handlers so we introduce a new + /// ACE::make_event_handler which can be used in user code to + /// allocate a new ACE event handler instance and directly assign + /// it to a ACE_Event_Handler_var + /// As user this now makes it for example possible to implement + /// the following when Simple_Handler is derived from ACE_Event_Handler + /// ACE_Event_Handler_var v = + /// ACE::make_event_handler<Simple_Handler> (reactor.get()); + template<class T, + typename = typename + std::enable_if<std::is_base_of<ACE_Event_Handler, T>::value>::type, + typename ...Args> inline + ACE_Event_Handler_var make_event_handler (Args&& ...args) + { + return ACE_Event_Handler_var (new T (std::forward<Args> (args)...)); + } +} + +#endif + /** * @class ACE_Notification_Buffer * - * @brief Simple wrapper for passing <ACE_Event_Handler *>s and + * @brief Simple wrapper for passing ACE_Event_Handler *s and * ACE_Reactor_Masks between threads. */ class ACE_Export ACE_Notification_Buffer diff --git a/ACE/ace/Get_Opt.cpp b/ACE/ace/Get_Opt.cpp index e83f44786fc..603126b3ed2 100644 --- a/ACE/ace/Get_Opt.cpp +++ b/ACE/ace/Get_Opt.cpp @@ -130,7 +130,7 @@ ACE_Get_Opt::ACE_Get_Opt (int argc, this->ordering_ = REQUIRE_ORDER; // Now, check to see if any or the following were passed at - // the begining of optstring: '+' same as POSIXLY_CORRECT; + // the beginning of optstring: '+' same as POSIXLY_CORRECT; // '-' turns off POSIXLY_CORRECT; or ':' which signifies we // should return ':' if a parameter is missing for an option. // We use a loop here, since a combination of "{+|-}:" in any diff --git a/ACE/ace/MMAP_Memory_Pool.cpp b/ACE/ace/MMAP_Memory_Pool.cpp index bc942e03e8f..2dada204cdf 100644 --- a/ACE/ace/MMAP_Memory_Pool.cpp +++ b/ACE/ace/MMAP_Memory_Pool.cpp @@ -476,7 +476,7 @@ ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( install_signal_handler_ (install_signal_handler) { ACE_TRACE ("ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options"); - // for backwards compatability + // for backwards compatibility if (base_addr_ == 0 && use_fixed_addr_ == ALWAYS_FIXED) use_fixed_addr_ = FIRSTCALL_FIXED; } diff --git a/ACE/ace/OS_NS_stdio.inl b/ACE/ace/OS_NS_stdio.inl index 60031b4fd63..66798d3c36d 100644 --- a/ACE/ace/OS_NS_stdio.inl +++ b/ACE/ace/OS_NS_stdio.inl @@ -1041,14 +1041,7 @@ ACE_OS::vsnprintf (char *buffer, size_t maxlen, const char *format, va_list ap) { #if !defined (ACE_LACKS_VSNPRINTF) int result; -# if 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ - // _vsnprintf_s() doesn't report the length needed when it truncates. This - // info is needed and relied on by others things in ACE+TAO, so don't use - // this. There's adequate protection via the maxlen. - result = _vsnprintf_s (buffer, maxlen, _TRUNCATE, format, ap); -# elif !defined (ACE_WIN32) - result = ::vsnprintf (buffer, maxlen, format, ap); -# else +# if defined (ACE_WIN32) && !defined (ACE_HAS_C99_VSNPRINTF) result = ::_vsnprintf (buffer, maxlen, format, ap); // Win32 doesn't regard a full buffer with no 0-terminate as an overrun. @@ -1058,6 +1051,8 @@ ACE_OS::vsnprintf (char *buffer, size_t maxlen, const char *format, va_list ap) // Win32 doesn't 0-terminate the string if it overruns maxlen. if (result == -1 && maxlen > 0) buffer[maxlen-1] = '\0'; +# else + result = ::vsnprintf (buffer, maxlen, format, ap); # endif // In out-of-range conditions, C99 defines vsnprintf() to return the number // of characters that would have been written if enough space was available. @@ -1093,7 +1088,7 @@ ACE_OS::vsnprintf (wchar_t *buffer, size_t maxlen, const wchar_t *format, va_lis int result; -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) && !defined (ACE_HAS_C99_VSNWPRINTF) // Microsoft's vswprintf() doesn't have the maxlen argument that // XPG4/UNIX98 define. They do, however, recommend use of _vsnwprintf() // as a substitute, which does have the same signature as the UNIX98 one. @@ -1119,15 +1114,12 @@ ACE_OS::vsnprintf (wchar_t *buffer, size_t maxlen, const wchar_t *format, va_lis result = static_cast <int> (maxlen + 1); return result; - # else - ACE_UNUSED_ARG (buffer); ACE_UNUSED_ARG (maxlen); ACE_UNUSED_ARG (format); ACE_UNUSED_ARG (ap); ACE_NOTSUP_RETURN (-1); - # endif /* platforms with a variant of vswprintf */ } #endif /* ACE_HAS_WCHAR */ diff --git a/ACE/ace/SOCK_Dgram_Bcast.cpp b/ACE/ace/SOCK_Dgram_Bcast.cpp index 0dd31d46c1a..b6538f5326a 100644 --- a/ACE/ace/SOCK_Dgram_Bcast.cpp +++ b/ACE/ace/SOCK_Dgram_Bcast.cpp @@ -260,7 +260,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) { if (host_name != 0) ACELIB_ERROR ((LM_ERROR, ACE_TEXT("%p [%s]\n"), - ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: Broadcast is not enable for this interface."), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: Broadcast is not enabled for this interface."), flags.ifr_name)); } } diff --git a/ACE/ace/Select_Reactor_Base.cpp b/ACE/ace/Select_Reactor_Base.cpp index 68d74c16b32..8ab0fd495d7 100644 --- a/ACE/ace/Select_Reactor_Base.cpp +++ b/ACE/ace/Select_Reactor_Base.cpp @@ -1013,7 +1013,7 @@ ACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, { case ACE_Reactor::GET_MASK: // The work for this operation is done in all cases at the - // begining of the function. + // beginning of the function. break; case ACE_Reactor::CLR_MASK: ptmf = &ACE_Handle_Set::clr_bit; diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index a7b9cea1c01..62192cae9be 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -60,7 +60,7 @@ ACE_Service_Type_Dynamic_Guard::ACE_Service_Type_Dynamic_Guard if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) STDG::<ctor>, repo=%@") - ACE_TEXT(", name=%s - begining at [%d]\n"), + ACE_TEXT(", name=%s - beginning at [%d]\n"), &this->repo_, this->name_, this->repo_begin_)); diff --git a/ACE/ace/Sock_Connect.cpp b/ACE/ace/Sock_Connect.cpp index 1e92a37463c..beaef532ffc 100644 --- a/ACE/ace/Sock_Connect.cpp +++ b/ACE/ace/Sock_Connect.cpp @@ -314,7 +314,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE::get_bcast_addr:") - ACE_TEXT ("Broadcast is not enable for this interface."))); + ACE_TEXT ("Broadcast is not enabled for this interface."))); if (handle == ACE_INVALID_HANDLE) ACE_OS::close (s); diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp index 9a9ba2edf22..e39247ee394 100644 --- a/ACE/ace/WFMO_Reactor.cpp +++ b/ACE/ace/WFMO_Reactor.cpp @@ -173,7 +173,7 @@ ACE_WFMO_Reactor_Handler_Repository::bit_ops (long &existing_masks, case ACE_Reactor::GET_MASK: // The work for this operation is done in all cases at the - // begining of the function. + // beginning of the function. ACE_UNUSED_ARG (change_masks); diff --git a/ACE/ace/config-win32-msvc-14.h b/ACE/ace/config-win32-msvc-14.h index 8135f65d870..7af34974814 100644 --- a/ACE/ace/config-win32-msvc-14.h +++ b/ACE/ace/config-win32-msvc-14.h @@ -28,8 +28,14 @@ // Until we have specific msvc14 settings, include the msvc12 file #include "ace/config-win32-msvc-12.h" -# define ACE_HAS_POSIX_TIME 1 -# define ACE_LACKS_TIMESPEC_T 1 +#define ACE_HAS_POSIX_TIME 1 +#define ACE_LACKS_TIMESPEC_T 1 + +// According to MS the Visual Studio 2014 C-runtime has a +// C99 compliant vsnprintf/vsnwprintf, this is a change compared to +// previous versions +#define ACE_HAS_C99_VSNPRINTF +#define ACE_HAS_C99_VSNWPRINTF #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_14_H */ |