mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 18:09:48 +00:00
Fix Cygwin Newlib signal handler (Issue 315)
This commit is contained in:
parent
7ce3922b97
commit
5596f73371
@ -690,7 +690,9 @@ NAMESPACE_END
|
||||
# define THREADS_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) || defined(__CYGWIN__)
|
||||
// Newlib on Cygwin is a problem. __NEWLIB__ is not defined yet; use __CYGWIN__ as a proxy
|
||||
// Also see https://github.com/weidai11/cryptopp/issues/315
|
||||
#if defined(CRYPTOPP_UNIX_AVAILABLE) && !defined(__CYGWIN__)
|
||||
# define UNIX_SIGNALS_AVAILABLE 1
|
||||
#endif
|
||||
|
||||
|
4
config.h
4
config.h
@ -690,7 +690,9 @@ NAMESPACE_END
|
||||
# define THREADS_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) || defined(__CYGWIN__)
|
||||
// Newlib on Cygwin is a problem. __NEWLIB__ is not defined yet; use __CYGWIN__ as a proxy
|
||||
// Also see https://github.com/weidai11/cryptopp/issues/315
|
||||
#if defined(CRYPTOPP_UNIX_AVAILABLE) && !defined(__CYGWIN__)
|
||||
# define UNIX_SIGNALS_AVAILABLE 1
|
||||
#endif
|
||||
|
||||
|
2
test.cpp
2
test.cpp
@ -126,7 +126,7 @@ RandomNumberGenerator & GlobalRNG()
|
||||
}
|
||||
|
||||
// See misc.h and trap.h for comments and usage
|
||||
#if CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
|
||||
#if CRYPTOPP_DEBUG && defined(UNIX_SIGNALS_AVAILABLE)
|
||||
static const SignalHandler<SIGTRAP, false> s_dummyHandler;
|
||||
// static const DebugTrapHandler s_dummyHandler;
|
||||
#endif
|
||||
|
10
trap.h
10
trap.h
@ -21,9 +21,9 @@
|
||||
#if CRYPTOPP_DEBUG
|
||||
# include <iostream>
|
||||
# include <sstream>
|
||||
# if defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
|
||||
# if defined(UNIX_SIGNALS_AVAILABLE)
|
||||
# include "ossig.h"
|
||||
# elif defined(CRYPTOPP_WIN32_AVAILABLE)
|
||||
# elif defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(__CYGWIN__)
|
||||
# if (_MSC_VER >= 1400)
|
||||
# include <intrin.h>
|
||||
# endif
|
||||
@ -62,7 +62,7 @@
|
||||
# define CRYPTOPP_ASSERT(exp) { ... }
|
||||
#endif
|
||||
|
||||
#if CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
|
||||
#if CRYPTOPP_DEBUG && defined(UNIX_SIGNALS_AVAILABLE)
|
||||
# define CRYPTOPP_ASSERT(exp) { \
|
||||
if (!(exp)) { \
|
||||
std::ostringstream oss; \
|
||||
@ -73,7 +73,7 @@
|
||||
raise(SIGTRAP); \
|
||||
} \
|
||||
}
|
||||
#elif CRYPTOPP_DEBUG && defined(CRYPTOPP_WIN32_AVAILABLE)
|
||||
#elif CRYPTOPP_DEBUG && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(__CYGWIN__)
|
||||
# define CRYPTOPP_ASSERT(exp) { \
|
||||
if (!(exp)) { \
|
||||
std::ostringstream oss; \
|
||||
@ -96,7 +96,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
// ************** SIGTRAP handler ***************
|
||||
|
||||
#if (CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
|
||||
#if (CRYPTOPP_DEBUG && defined(UNIX_SIGNALS_AVAILABLE)) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
|
||||
//! \brief Default SIGTRAP handler
|
||||
//! \details DebugTrapHandler() can be used by a program to install an empty SIGTRAP handler. If present,
|
||||
//! the handler ensures there is a signal handler in place for <tt>SIGTRAP</tt> raised by
|
||||
|
Loading…
Reference in New Issue
Block a user