Fixed 32-bit.

This commit is contained in:
XMRig 2019-08-02 10:54:00 +07:00
parent 37710b0c7b
commit 718be7e9aa
3 changed files with 26 additions and 2 deletions

View file

@ -34,7 +34,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
endif() endif()
if (WIN32) if (WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,--large-address-aware")
endif()
else() else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif() endif()

View file

@ -160,3 +160,20 @@ void xmrig::Job::setDiff(uint64_t diff)
m_rawTarget[16] = '\0'; m_rawTarget[16] = '\0';
# endif # endif
} }
void xmrig::Job::copy(const Job &other)
{
m_algorithm = other.m_algorithm;
m_nicehash = other.m_nicehash;
m_size = other.m_size;
m_clientId = other.m_clientId;
m_id = other.m_id;
m_diff = other.m_diff;
m_height = other.m_height;
m_target = other.m_target;
m_index = other.m_index;
memcpy(m_blob, other.m_blob, sizeof (m_blob));
memcpy(m_seedHash, other.m_seedHash, sizeof(m_seedHash));
}

View file

@ -90,8 +90,11 @@ public:
inline bool operator==(const Job &other) const { return isEqual(other); } inline bool operator==(const Job &other) const { return isEqual(other); }
inline bool operator!=(const Job &other) const { return !isEqual(other); } inline bool operator!=(const Job &other) const { return !isEqual(other); }
inline Job &operator=(const Job &other) { copy(other); return *this; }
private: private:
void copy(const Job &other);
Algorithm m_algorithm; Algorithm m_algorithm;
bool m_nicehash = false; bool m_nicehash = false;
size_t m_size = 0; size_t m_size = 0;