diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-08-16 12:21:07 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-08-16 12:21:07 -0400 |
commit | c40a4dc9f71f1fe1683dd5cad933fe59748e8caf (patch) | |
tree | 9ce6721367a5430177c1eb393a6bde5ae6a0fd24 | |
parent | 8f4b0dc0816aec3bbf9e1a716c941aeafb5ae49c (diff) | |
download | cryptopp-git-c40a4dc9f71f1fe1683dd5cad933fe59748e8caf.tar.gz |
Fix Clang warning on missing template definitions
-rw-r--r-- | bench2.cpp | 1 | ||||
-rw-r--r-- | dll.cpp | 1 | ||||
-rw-r--r-- | dlltest.cpp | 1 | ||||
-rw-r--r-- | fipstest.cpp | 1 | ||||
-rw-r--r-- | luc.cpp | 1 | ||||
-rw-r--r-- | pkcspad.h | 9 | ||||
-rw-r--r-- | rsa.cpp | 1 | ||||
-rw-r--r-- | test.cpp | 1 | ||||
-rw-r--r-- | validat2.cpp | 1 |
9 files changed, 16 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
+#include "pkcspad.h"
#include "files.h"
#include "filters.h"
@@ -6,6 +6,7 @@ #include "dll.h"
#include "config.h"
#include "iterhash.h"
+#include "pkcspad.h"
// Cast from FARPROC to funcptr with args, http://stackoverflow.com/q/4192058/608639
#pragma warning(disable: 4191)
diff --git a/dlltest.cpp b/dlltest.cpp index e46ccdd5..addced55 100644 --- a/dlltest.cpp +++ b/dlltest.cpp @@ -5,6 +5,7 @@ #include "dll.h"
#include "cryptlib.h"
#include "filters.h"
+#include "pkcspad.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
diff --git a/fipstest.cpp b/fipstest.cpp index 132c6510..3a1d9070 100644 --- a/fipstest.cpp +++ b/fipstest.cpp @@ -10,6 +10,7 @@ #include "cryptlib.h"
#include "filters.h"
#include "smartptr.h"
+#include "pkcspad.h"
#include "misc.h"
// Simply disable CRYPTOPP_WIN32_AVAILABLE for Windows Phone and Windows Store apps
@@ -7,6 +7,7 @@ #include "integer.h"
#include "nbtheory.h"
#include "algparam.h"
+#include "pkcspad.h"
NAMESPACE_BEGIN(CryptoPP)
@@ -53,12 +53,19 @@ class MD5; }
// end of list
-#ifdef CRYPTOPP_IS_DLL
+#if defined(CRYPTOPP_IS_DLL)
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA1>;
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA224>;
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA256>;
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA384>;
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA512>;
+#elif defined(__clang__)
+// Provide a default definition to avoid Clang warnings. CRTP will provide a
+// real definition later. The single element is due to MSVC compile failures
+// after adding the default definition. However, GCC produces multiple
+// definitions which result in link failures. I give up...
+template <class H>
+const byte PKCS_DigestDecoration<H>::decoration[1] = {0x00};
#endif
//! \class PKCS1v15_SignatureMessageEncodingMethod
@@ -9,6 +9,7 @@ #include "nbtheory.h"
#include "algparam.h"
#include "fips140.h"
+#include "pkcspad.h"
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
@@ -24,6 +24,7 @@ #include "whrlpool.h"
#include "tiger.h"
#include "smartptr.h"
+#include "pkcspad.h"
#include "stdcpp.h"
#include "ossig.h"
#include "trap.h"
diff --git a/validat2.cpp b/validat2.cpp index 3d984e92..e0fde064 100644 --- a/validat2.cpp +++ b/validat2.cpp @@ -39,6 +39,7 @@ #include "sha.h"
#include "ripemd.h"
#include "smartptr.h"
+#include "pkcspad.h"
#include <iostream>
#include <sstream>
|