diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-11-12 11:55:57 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-11-12 11:55:57 -0500 |
commit | bf717f47e6b4ffcf6935a9d5512d5e211d96b59e (patch) | |
tree | 6c04d7e6d5f5b6bc348c47628b65e7d63b76dbc5 /cryptlib.cpp | |
parent | d28e813ac36b12ec269c69fff528744f0cfe4738 (diff) | |
download | cryptopp-git-bf717f47e6b4ffcf6935a9d5512d5e211d96b59e.tar.gz |
Reduce C++ file scope class objects
Update comments and documentation
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r-- | cryptlib.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp index 3de5c02b..b6e91f07 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -42,6 +42,7 @@ CRYPTOPP_COMPILE_ASSERT(sizeof(word64) == 8); CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word));
#endif
+#if 0
class NullNameValuePairs : public NameValuePairs
{
public:
@@ -49,6 +50,7 @@ public: bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
{CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); return false;}
};
+#endif
BufferedTransformation & TheBitBucket()
{
@@ -945,27 +947,13 @@ int LibraryVersion(CRYPTOPP_NOINLINE_DOTDOTDOT) }
// ***************** C++ Static Initialization ********************
-// We can't put these in the anonymous namespace. DEFAULT_CHANNEL,
-// AAD_CHANNEL and g_nullNameValuePairs must be defined in CryptoPP.
-
-#if HAVE_GCC_INIT_PRIORITY
-const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 10))) = "";
-const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 11))) = "AAD";
-const NullNameValuePairs s_nullNameValuePairs __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 12)));
-const NameValuePairs &g_nullNameValuePairs = dynamic_cast<const NameValuePairs&>(s_nullNameValuePairs);
-#elif HAVE_MSC_INIT_PRIORITY
-#pragma warning(disable: 4075)
-#pragma init_seg(".CRT$XCU-010")
-const std::string DEFAULT_CHANNEL("");
+
+#if 0
+const std::string DEFAULT_CHANNEL;
const std::string AAD_CHANNEL("AAD");
-const NullNameValuePairs s_nullNameValuePairs;
-const NameValuePairs &g_nullNameValuePairs = dynamic_cast<const NameValuePairs&>(s_nullNameValuePairs);
-#pragma warning(default: 4075)
-#else
-const std::string DEFAULT_CHANNEL = "";
-const std::string AAD_CHANNEL = "AAD";
-const simple_ptr<NullNameValuePairs> s_pNullNameValuePairs(new NullNameValuePairs);
-const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p;
+
+NullNameValuePairs s_nullNameValuePairs;
+const NameValuePairs&g_nullNameValuePairs = dynamic_cast<const NameValuePairs&>(s_nullNameValuePairs);
#endif
NAMESPACE_END // CryptoPP
|