From 246233c40262c5be2edfa916cf841dd4bce6598e Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Aug 2016 22:08:47 +0200 Subject: Windows EFI Bootloader: modifications to prepare EFI system encryption support (common files with DcsBoot) --- src/Crypto/misc.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Crypto/misc.h') diff --git a/src/Crypto/misc.h b/src/Crypto/misc.h index e4570664..e7391764 100644 --- a/src/Crypto/misc.h +++ b/src/Crypto/misc.h @@ -2,15 +2,19 @@ #define CRYPTOPP_MISC_H #include "config.h" +#if !defined(_UEFI) #include // for memcpy and memmove #ifndef _WIN32 #include // for strcasecmp #define _stricmp strcasecmp #endif +#else +#include "Tcdefs.h" +#endif // !defined(_UEFI) -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(_UEFI) #if _MSC_VER >= 1400 - #ifndef TC_WINDOWS_DRIVER + #if !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI) // VC2005 workaround: disable declarations that conflict with winnt.h #define _interlockedbittestandset CRYPTOPP_DISABLED_INTRINSIC_1 #define _interlockedbittestandreset CRYPTOPP_DISABLED_INTRINSIC_2 @@ -23,7 +27,7 @@ #undef _interlockedbittestandreset64 #endif #define CRYPTOPP_FAST_ROTATE(x) 1 - #elif _MSC_VER >= 1300 + #elif !defined(_UEFI) && _MSC_VER >= 1300 #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64) #else #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) @@ -37,7 +41,7 @@ #define CRYPTOPP_FAST_ROTATE(x) 0 #endif -#if defined( _MSC_VER ) && ( _MSC_VER > 800 ) +#if defined( _MSC_VER ) && ( _MSC_VER > 800 ) && !defined(_UEFI) #pragma intrinsic(memcpy,memset) #endif @@ -80,7 +84,7 @@ #if defined(__GNUC__) && defined(__linux__) #define CRYPTOPP_BYTESWAP_AVAILABLE #include -#elif defined(_MSC_VER) && _MSC_VER >= 1300 +#elif defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_UEFI) #define CRYPTOPP_BYTESWAP_AVAILABLE #define bswap_32(x) _byteswap_ulong(x) #define bswap_64(x) _byteswap_uint64(x) -- cgit v1.2.3