Windows build fixes and warning avoidance

This commit is contained in:
Jack Andersen
2018-05-24 20:38:06 -10:00
parent 51a15e474e
commit d5f5db440c
7 changed files with 30 additions and 28 deletions

View File

@@ -8,6 +8,10 @@
#include <cpuid.h>
#endif
#if __AES__ || (!defined(__clang__) && _MSC_VER >= 1800)
#define _AES_NI 1
#endif
namespace nod
{
@@ -468,7 +472,7 @@ void SoftwareAES::encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outb
}
}
#if __AES__ || _MSC_VER >= 1800
#if _AES_NI
#include <wmmintrin.h>
@@ -583,12 +587,13 @@ public:
}
};
static int HAS_AES_NI = -1;
#endif
static int HAS_AES_NI = -1;
std::unique_ptr<IAES> NewAES()
{
#if __AES__ || _MSC_VER >= 1800
#if _AES_NI
if (HAS_AES_NI == -1)
{
#if _MSC_VER