patch: trivial compile fix for Visual Studio 2010 / VC10

105 views
Skip to first unread message

Patrick Dawson

unread,
Dec 17, 2009, 6:12:18 PM12/17/09
to Crypto++ Users
VC10 apparently wants an explicit cast of NULL to the appropriate type
in a std::pair. This was the only change necessary to get Crypto++ to
compile without errors on Visual Studio 2010 Beta 2.

--- pubkey.h.orig 2009-12-17 18:03:49.000000000 -0500
+++ pubkey.h 2009-12-17 18:04:21.000000000 -0500
@@ -240,7 +240,7 @@
{
static HashIdentifier CRYPTOPP_API Lookup()
{
- return HashIdentifier(NULL, 0);
+ return HashIdentifier(static_cast<const byte*>(NULL), 0);
}
};
};

Patrick Dawson

unread,
Dec 18, 2009, 10:02:10 AM12/18/09
to Crypto++ Users
Oops, I missed something in zdeflate.cpp. Wei Dai is obviously already
aware of this issue, but in case anyone else needs to compile Crypto++
in VC10 right now, here's the full patch.

I believe this is the appropriate fix, based on the response from
Microsoft here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=507723

This was written against the SVN trunk, but it also applies to an
unmodified Crypto++ 5.6.0. Building everything in cryptest.sln works,
and all the cryptest validation tests pass (Win32/x64 Debug/Release).


Index: zdeflate.cpp
===================================================================
--- zdeflate.cpp (revision 479)
+++ zdeflate.cpp (working copy)
@@ -386,7 +386,7 @@
{
assert(scan[2] == match[2]);
unsigned int len = (unsigned int)(
-#if defined(_STDEXT_BEGIN) && !(defined(_MSC_VER) && _MSC_VER < 1400)
&& !defined(_STLPORT_VERSION)
+#if defined(_STDEXT_BEGIN) && !(defined(_MSC_VER) && (_MSC_VER < 1400
|| _MSC_VER >= 1600)) && !defined(_STLPORT_VERSION)
stdext::unchecked_mismatch
#else
std::mismatch
Index: pubkey.h
===================================================================
--- pubkey.h (revision 479)
+++ pubkey.h (working copy)

Reply all
Reply to author
Forward
0 new messages