summaryrefslogtreecommitdiff
path: root/ossig.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-18 17:29:32 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-18 17:29:32 -0400
commitd689c11b2dc9f77cc952833cba4edab52d12a79f (patch)
treea36f119394a7ad0b65d16a1a9443892ed5eb228f /ossig.h
parentf57c4dced5bfbcd10d0883ae7161833a70eff268 (diff)
downloadcryptopp-git-d689c11b2dc9f77cc952833cba4edab52d12a79f.tar.gz
Fix compile under SunCC 5.11-5.13 (Issue 285)
Diffstat (limited to 'ossig.h')
-rw-r--r--ossig.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/ossig.h b/ossig.h
index bab446d2..27df5562 100644
--- a/ossig.h
+++ b/ossig.h
@@ -18,6 +18,7 @@ NAMESPACE_BEGIN(CryptoPP)
// ************** Unix and Linux compatibles ***************
#if defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
+
//! \brief Signal handler function pointer
//! \sa SignalHandler
extern "C" {
@@ -55,11 +56,10 @@ struct SignalHandler
//! because the destructor may not run. <tt>setjmp</tt> is why cpu.cpp does not use SignalHandler
//! during CPU feature testing.
//! \since Crypto++ 5.6.5
- SignalHandler(SignalHandlerFn pfn = 0, int flags = 0) : m_installed(false)
+ SignalHandler(SignalHandlerFn pfn = NULL, int flags = 0) : m_installed(false)
{
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/sigaction.html
struct sigaction new_handler;
- // memset(&new_handler, 0x00, sizeof(new_handler));
do
{
@@ -71,8 +71,8 @@ struct SignalHandler
// Don't step on another's handler if Overwrite=false
if (m_old.sa_handler != 0 && !O) break;
- // Set up the structure to specify the action.
- new_handler.sa_handler = (pfn ? pfn : &SignalHandler::NullHandler);
+ // Sun Studio 12.2-12.4 needs the two casts, and they must be C-style casts
+ new_handler.sa_handler = (SignalHandlerFn)(pfn ? pfn : (SignalHandlerFn)&SignalHandler::NullHandler);
new_handler.sa_flags = (pfn ? flags : 0);
ret = sigemptyset (&new_handler.sa_mask);