summaryrefslogtreecommitdiff
path: root/pkcspad.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-08-16 12:21:07 -0400
committerJeffrey Walton <noloader@gmail.com>2017-08-16 12:21:07 -0400
commitc40a4dc9f71f1fe1683dd5cad933fe59748e8caf (patch)
tree9ce6721367a5430177c1eb393a6bde5ae6a0fd24 /pkcspad.h
parent8f4b0dc0816aec3bbf9e1a716c941aeafb5ae49c (diff)
downloadcryptopp-git-c40a4dc9f71f1fe1683dd5cad933fe59748e8caf.tar.gz
Fix Clang warning on missing template definitions
Diffstat (limited to 'pkcspad.h')
-rw-r--r--pkcspad.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkcspad.h b/pkcspad.h
index b75bce6a..5d4909fb 100644
--- a/pkcspad.h
+++ b/pkcspad.h
@@ -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