summaryrefslogtreecommitdiff
path: root/secblock.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-04 00:17:37 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-04 00:17:37 +0000
commit572fe07633123ce38abf28c6426356e37aef3a99 (patch)
tree0536d87e504a82920156c239bc5ae6aa43e70ebc /secblock.h
parent3e8c979ddc194e043567c036321e67c89f847362 (diff)
downloadcryptopp-572fe07633123ce38abf28c6426356e37aef3a99.tar.gz
create DLL version, fix GetNextIV() bug in CTR and OFB modes
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@87 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'secblock.h')
-rw-r--r--secblock.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/secblock.h b/secblock.h
index e07c6a2..580aab7 100644
--- a/secblock.h
+++ b/secblock.h
@@ -18,7 +18,7 @@ class AllocatorBase
public:
typedef T value_type;
typedef size_t size_type;
-#if (defined(_MSC_VER) && _MSC_VER < 1300)
+#ifdef CRYPTOPP_MSVCRT6
typedef ptrdiff_t difference_type;
#else
typedef std::ptrdiff_t difference_type;
@@ -94,6 +94,10 @@ public:
template <class U> struct rebind { typedef AllocatorWithCleanup<U> other; };
};
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<byte>;
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word16>;
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word32>;
+
template <class T>
class NullAllocator : public AllocatorBase<T>
{
@@ -325,7 +329,12 @@ public:
m_size = newSize;
}
- void swap(SecBlock<T, A> &b);
+ void swap(SecBlock<T, A> &b)
+ {
+ std::swap(m_alloc, b.m_alloc);
+ std::swap(m_size, b.m_size);
+ std::swap(m_ptr, b.m_ptr);
+ }
//private:
A m_alloc;
@@ -333,13 +342,6 @@ public:
T *m_ptr;
};
-template <class T, class A> void SecBlock<T, A>::swap(SecBlock<T, A> &b)
-{
- std::swap(m_alloc, b.m_alloc);
- std::swap(m_size, b.m_size);
- std::swap(m_ptr, b.m_ptr);
-}
-
typedef SecBlock<byte> SecByteBlock;
typedef SecBlock<word> SecWordBlock;