diff --git a/atdna/CMakeLists.txt b/atdna/CMakeLists.txt index af9b4a5..bc00f92 100644 --- a/atdna/CMakeLists.txt +++ b/atdna/CMakeLists.txt @@ -6,8 +6,10 @@ if(NOT CMAKE_CROSSCOMPILING) # Force this binary to Release flags (to make MSVC happy) if(MSVC) -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE}") -set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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() # Find dependencies diff --git a/include/athena/FileWriter.hpp b/include/athena/FileWriter.hpp index 907f970..f908b4c 100644 --- a/include/athena/FileWriter.hpp +++ b/include/athena/FileWriter.hpp @@ -60,8 +60,6 @@ private: std::string m_filename; #endif HandleType m_fileHandle; - atUint8 m_currentByte; - atUint64 m_bytePosition; bool m_globalErr; }; diff --git a/src/aes.cpp b/src/aes.cpp index 2fcfcba..998e623 100644 --- a/src/aes.cpp +++ b/src/aes.cpp @@ -7,6 +7,10 @@ #include #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 @@ -582,12 +586,13 @@ public: } }; +static int HAS_AES_NI = -1; + #endif -static int HAS_AES_NI = -1; std::unique_ptr NewAES() { -#if __AES__ || _MSC_VER >= 1800 +#if _AES_NI if (HAS_AES_NI == -1) { #if _MSC_VER diff --git a/src/athena/FileWriterWin32.cpp b/src/athena/FileWriterWin32.cpp index d5e0023..1dcfdb1 100644 --- a/src/athena/FileWriterWin32.cpp +++ b/src/athena/FileWriterWin32.cpp @@ -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;