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

@ -6,8 +6,10 @@ if(NOT CMAKE_CROSSCOMPILING)
# Force this binary to Release flags (to make MSVC happy) # Force this binary to Release flags (to make MSVC happy)
if(MSVC) if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob2 /DNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "-debug -incremental:no")
endif() endif()
# Find dependencies # Find dependencies

View File

@ -60,8 +60,6 @@ private:
std::string m_filename; std::string m_filename;
#endif #endif
HandleType m_fileHandle; HandleType m_fileHandle;
atUint8 m_currentByte;
atUint64 m_bytePosition;
bool m_globalErr; bool m_globalErr;
}; };

View File

@ -7,6 +7,10 @@
#include <cpuid.h> #include <cpuid.h>
#endif #endif
#if __AES__ || (!defined(__clang__) && _MSC_VER >= 1800)
#define _AES_NI 1
#endif
namespace athena 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> #include <wmmintrin.h>
@ -582,12 +586,13 @@ public:
} }
}; };
static int HAS_AES_NI = -1;
#endif #endif
static int HAS_AES_NI = -1;
std::unique_ptr<IAES> NewAES() std::unique_ptr<IAES> NewAES()
{ {
#if __AES__ || _MSC_VER >= 1800 #if _AES_NI
if (HAS_AES_NI == -1) if (HAS_AES_NI == -1)
{ {
#if _MSC_VER #if _MSC_VER

View File

@ -5,7 +5,6 @@ namespace athena::io
{ {
FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr) FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr)
: m_fileHandle(0), : m_fileHandle(0),
m_bytePosition(0),
m_globalErr(globalErr) m_globalErr(globalErr)
{ {
m_filename = utility::utf8ToWide(filename); 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) FileWriter::FileWriter(std::wstring_view filename, bool overwrite, bool globalErr)
: m_fileHandle(0), : m_fileHandle(0),
m_bytePosition(0),
m_globalErr(globalErr) m_globalErr(globalErr)
{ {
m_filename = filename; m_filename = filename;