summaryrefslogtreecommitdiff
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
parent8f4b0dc0816aec3bbf9e1a716c941aeafb5ae49c (diff)
downloadcryptopp-git-c40a4dc9f71f1fe1683dd5cad933fe59748e8caf.tar.gz
Fix Clang warning on missing template definitions
-rw-r--r--bench2.cpp1
-rw-r--r--dll.cpp1
-rw-r--r--dlltest.cpp1
-rw-r--r--fipstest.cpp1
-rw-r--r--luc.cpp1
-rw-r--r--pkcspad.h9
-rw-r--r--rsa.cpp1
-rw-r--r--test.cpp1
-rw-r--r--validat2.cpp1
9 files changed, 16 insertions, 1 deletions
diff --git a/bench2.cpp b/bench2.cpp
index 3d07b2d0..4381d317 100644
--- a/bench2.cpp
+++ b/bench2.cpp
@@ -8,6 +8,7 @@
#include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
+#include "pkcspad.h"
#include "files.h"
#include "filters.h"
diff --git a/dll.cpp b/dll.cpp
index 372ed712..9cd51d15 100644
--- a/dll.cpp
+++ b/dll.cpp
@@ -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
diff --git a/luc.cpp b/luc.cpp
index 702fc9f6..9a25662c 100644
--- a/luc.cpp
+++ b/luc.cpp
@@ -7,6 +7,7 @@
#include "integer.h"
#include "nbtheory.h"
#include "algparam.h"
+#include "pkcspad.h"
NAMESPACE_BEGIN(CryptoPP)
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
diff --git a/rsa.cpp b/rsa.cpp
index 6853d22d..095a99dd 100644
--- a/rsa.cpp
+++ b/rsa.cpp
@@ -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"
diff --git a/test.cpp b/test.cpp
index de97afb2..1d7a7b7d 100644
--- a/test.cpp
+++ b/test.cpp
@@ -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>