mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 01:49:41 +00:00
Use define CRYPTOPP_CXX11_STATIC_INIT name
This commit is contained in:
parent
7d0859d9db
commit
2c6e4b17d7
@ -722,9 +722,9 @@ rm -f config_cxx.h.new
|
||||
|
||||
CXX_RESULT=$(${CXX} ${CXXFLAGS} TestPrograms/test_cxx11_staticinit.cxx -o ${TOUT} 2>&1 | wc -w)
|
||||
if [[ "${CXX_RESULT}" -eq 0 ]]; then
|
||||
echo '#define CRYPTOPP_CXX11_DYNAMIC_INIT 1'
|
||||
echo '#define CRYPTOPP_CXX11_STATIC_INIT 1'
|
||||
else
|
||||
echo '// #define CRYPTOPP_CXX11_DYNAMIC_INIT 1'
|
||||
echo '// #define CRYPTOPP_CXX11_STATIC_INIT 1'
|
||||
fi
|
||||
|
||||
CXX_RESULT=$(${CXX} ${CXXFLAGS} TestPrograms/test_cxx11_deletefn.cxx -o ${TOUT} 2>&1 | wc -w)
|
||||
|
@ -124,7 +124,7 @@
|
||||
(CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \
|
||||
(CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \
|
||||
(__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
|
||||
# define CRYPTOPP_CXX11_DYNAMIC_INIT 1
|
||||
# define CRYPTOPP_CXX11_STATIC_INIT 1
|
||||
#endif // Dynamic Initialization compilers
|
||||
|
||||
// deleted functions: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; Intel 12.1; SunCC 5.13.
|
||||
|
2
cpu.cpp
2
cpu.cpp
@ -234,7 +234,7 @@ private:
|
||||
|
||||
void GetAppleMachineInfo(unsigned int& device, unsigned int& version, unsigned int& arch)
|
||||
{
|
||||
#if CRYPTOPP_CXX11_DYNAMIC_INIT
|
||||
#if CRYPTOPP_CXX11_STATIC_INIT
|
||||
static const AppleMachineInfo info;
|
||||
#else
|
||||
using CryptoPP::Singleton;
|
||||
|
2
ec2n.cpp
2
ec2n.cpp
@ -198,7 +198,7 @@ const EC2N::Point& EC2N::Identity() const
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_identity;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const EC2N::Point g_identity;
|
||||
return g_identity;
|
||||
#else
|
||||
|
2
ecp.cpp
2
ecp.cpp
@ -719,7 +719,7 @@ const ECP::Point& ECP::Identity() const
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_identity;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const ECP::Point g_identity;
|
||||
return g_identity;
|
||||
#else
|
||||
|
4
gf2n.cpp
4
gf2n.cpp
@ -166,7 +166,7 @@ const PolynomialMod2 &PolynomialMod2::Zero()
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_zero;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const PolynomialMod2 g_zero;
|
||||
return g_zero;
|
||||
#else
|
||||
@ -178,7 +178,7 @@ const PolynomialMod2 &PolynomialMod2::One()
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_one;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const PolynomialMod2 g_one(1);
|
||||
return g_one;
|
||||
#else
|
||||
|
@ -4857,7 +4857,7 @@ const Integer &Integer::Zero()
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_zero;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const Integer s_zero(0L);
|
||||
return s_zero;
|
||||
#else // Potential memory leak. Avoid if possible.
|
||||
@ -4869,7 +4869,7 @@ const Integer &Integer::One()
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_one;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const Integer s_one(1L);
|
||||
return s_one;
|
||||
#else // Potential memory leak. Avoid if possible.
|
||||
@ -4881,7 +4881,7 @@ const Integer &Integer::Two()
|
||||
{
|
||||
#if defined(HAVE_GCC_INIT_PRIORITY) || defined(HAVE_MSC_INIT_PRIORITY) || defined(HAVE_XLC_INIT_PRIORITY)
|
||||
return g_two;
|
||||
#elif defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#elif defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const Integer s_two(2L);
|
||||
return s_two;
|
||||
#else // Potential memory leak. Avoid if possible.
|
||||
|
2
misc.h
2
misc.h
@ -324,7 +324,7 @@ private:
|
||||
template <class T, class F, int instance>
|
||||
const T & Singleton<T, F, instance>::Ref(CRYPTOPP_NOINLINE_DOTDOTDOT) const
|
||||
{
|
||||
#if defined(CRYPTOPP_CXX11_ATOMIC) && defined(CRYPTOPP_CXX11_SYNCHRONIZATION) && defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
#if defined(CRYPTOPP_CXX11_ATOMIC) && defined(CRYPTOPP_CXX11_SYNCHRONIZATION) && defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static std::mutex s_mutex;
|
||||
static std::atomic<T*> s_pObject;
|
||||
|
||||
|
@ -154,7 +154,7 @@ void NonblockingRng::GenerateBlock(byte *output, size_t size)
|
||||
{
|
||||
#ifdef CRYPTOPP_WIN32_AVAILABLE
|
||||
// Acquiring a provider is expensive. Do it once and retain the reference.
|
||||
# if defined(CRYPTOPP_CXX11_DYNAMIC_INIT)
|
||||
# if defined(CRYPTOPP_CXX11_STATIC_INIT)
|
||||
static const MicrosoftCryptoProvider hProvider = MicrosoftCryptoProvider();
|
||||
# else
|
||||
const MicrosoftCryptoProvider &hProvider = Singleton<MicrosoftCryptoProvider>().Ref();
|
||||
|
@ -322,7 +322,7 @@ inline std::string DataDir(const std::string& filename)
|
||||
std::string name;
|
||||
std::ifstream file;
|
||||
|
||||
#if CRYPTOPP_CXX11_DYNAMIC_INIT
|
||||
#if CRYPTOPP_CXX11_STATIC_INIT
|
||||
static std::string path = AddSeparator(GetDataDir());
|
||||
name = path + filename;
|
||||
file.open(name.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user