diff options
Diffstat (limited to 'ACE/ace')
-rw-r--r-- | ACE/ace/OS_NS_string.cpp | 6 | ||||
-rw-r--r-- | ACE/ace/Process.cpp | 3 | ||||
-rw-r--r-- | ACE/ace/Process_Manager.cpp | 3 | ||||
-rw-r--r-- | ACE/ace/config-macros.h | 11 |
4 files changed, 18 insertions, 5 deletions
diff --git a/ACE/ace/OS_NS_string.cpp b/ACE/ace/OS_NS_string.cpp index ff5c4e1e549..03a91a45f2c 100644 --- a/ACE/ace/OS_NS_string.cpp +++ b/ACE/ace/OS_NS_string.cpp @@ -83,9 +83,9 @@ ACE_OS::strerror (int errnum) if (ACE::is_sock_error (errnum)) { const ACE_TCHAR *errortext = ACE::sock_error (errnum); - ACE_OS::strncpy (ret_errortext, - ACE_TEXT_ALWAYS_CHAR (errortext), - sizeof (ret_errortext)); + ACE_OS::strsncpy (ret_errortext, + ACE_TEXT_ALWAYS_CHAR (errortext), + sizeof (ret_errortext)); return ret_errortext; } #if defined (ACE_LACKS_STRERROR) diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index a1921102960..10500483e30 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -695,7 +695,8 @@ ACE_Process::wait (const ACE_Time_Value &tv, // open(), and there's already a SIGCHLD action set, so no // action is needed here. ACE_Sig_Action old_action; - ACE_Sig_Action do_sigchld ((ACE_SignalHandler)sigchld_nop); + ACE_Sig_Handler_Ex sigchld_nop_ptr = sigchld_nop; + ACE_Sig_Action do_sigchld (reinterpret_cast<ACE_SignalHandler> (reinterpret_cast<void*> (sigchld_nop_ptr))); do_sigchld.register_action (SIGCHLD, &old_action); pid_t pid; diff --git a/ACE/ace/Process_Manager.cpp b/ACE/ace/Process_Manager.cpp index 4db0f020eed..6a609cb8dc0 100644 --- a/ACE/ace/Process_Manager.cpp +++ b/ACE/ace/Process_Manager.cpp @@ -888,7 +888,8 @@ ACE_Process_Manager::wait (pid_t pid, ACE_Sig_Action old_action; if (this->reactor () == 0) { - ACE_Sig_Action do_sigchld ((ACE_SignalHandler)sigchld_nop); + ACE_Sig_Handler_Ex sigchld_nop_ptr = sigchld_nop; + ACE_Sig_Action do_sigchld (reinterpret_cast<ACE_SignalHandler> (reinterpret_cast<void*> (sigchld_nop_ptr))); do_sigchld.register_action (SIGCHLD, &old_action); } diff --git a/ACE/ace/config-macros.h b/ACE/ace/config-macros.h index 5989d2cc6d8..c1aef4c1f08 100644 --- a/ACE/ace/config-macros.h +++ b/ACE/ace/config-macros.h @@ -277,6 +277,17 @@ # define ACE_NOTREACHED(a) a #endif /* ghs || ..... */ + +// Compiler-specific configs can define ACE_FALLTHROUGH but if not, +// and it's a C++17 or higher compiler, use the defined mechanism. +#if !defined ACE_FALLTHROUGH +# if defined ACE_HAS_CPP17 +# define ACE_FALLTHROUGH [[fallthrough]] +# else +# define ACE_FALLTHROUGH +# endif /* ACE_HAS_CPP17 */ +#endif /* ACE_FALLTHROUGH */ + // ============================================================================ // ACE_ALLOC_HOOK* macros // |