Windows build fixes

This commit is contained in:
Jack Andersen
2018-05-24 20:33:43 -10:00
parent c5e71f7569
commit ed83b2f42c
4 changed files with 12 additions and 9 deletions

View File

@@ -7,6 +7,10 @@
#include <cpuid.h>
#endif
#if __AES__ || (!defined(__clang__) && _MSC_VER >= 1800)
#define _AES_NI 1
#endif
namespace athena
{
@@ -467,7 +471,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>
@@ -582,12 +586,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

View File

@@ -5,7 +5,6 @@ namespace athena::io
{
FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr)
: m_fileHandle(0),
m_bytePosition(0),
m_globalErr(globalErr)
{
m_filename = utility::utf8ToWide(filename);
@@ -14,7 +13,6 @@ FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr
FileWriter::FileWriter(std::wstring_view filename, bool overwrite, bool globalErr)
: m_fileHandle(0),
m_bytePosition(0),
m_globalErr(globalErr)
{
m_filename = filename;