summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Raad <MarcelRaad@users.noreply.github.com>2017-06-24 23:41:20 +0200
committerJeffrey Walton <noloader@gmail.com>2017-06-24 17:41:20 -0400
commit32f715f1d723e2bbb78b44fa9e167da64214e2e6 (patch)
tree219071bb6bbd794e31b8c7f9a6eb2beadec9d128
parentaaf62695fc03bf941ec51e40a139f5e0eb8652f3 (diff)
downloadcryptopp-git-32f715f1d723e2bbb78b44fa9e167da64214e2e6.tar.gz
Fix Windows XP support on Visual Studio 2015+ (#439)
When compiling with Visual Studio 2015+, Crypto++ uses CryptoNG by default. CryptoNG is only available on Windows Vista and later and Crypto++ currently ignores if the user explicitly wants to target Windows XP. Unlike with other Windows SDK features, everything compiles, but the application doesn't start on Windows XP because bcrypt.dll is missing. That is an issue when updating Visual Studio because the root cause is hard to find. Making use of CryptoNG when targeting Windows 8+ instead by default, regardless of the Visual Studio version, to fix this.
-rw-r--r--config.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/config.h b/config.h
index d21b0d4a..291b1488 100644
--- a/config.h
+++ b/config.h
@@ -44,10 +44,10 @@
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
// #define USE_MS_CNGAPI
-// If the user did not make a choice, then select CryptoNG if either
-// Visual Studio 2015 is available, or Windows 10 or above is available.
+// If the user did not make a choice, then select CryptoNG if
+// targeting Windows 8 or above.
#if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI)
-# if (_MSC_VER >= 1900) || ((WINVER >= 0x0A00 /*_WIN32_WINNT_WIN10*/) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/))
+# if !defined(_USING_V110_SDK71_) && ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/))
# define USE_MS_CNGAPI
# else
# define USE_MS_CRYPTOAPI