diff --git a/crypto/cryptonight_aesni.h b/crypto/cryptonight_aesni.h index 8bbb27ce..34ab590c 100644 --- a/crypto/cryptonight_aesni.h +++ b/crypto/cryptonight_aesni.h @@ -21,7 +21,12 @@ #ifdef __GNUC__ #include -static inline uint64_t _umul128(uint64_t a, uint64_t b, uint64_t* hi) +#ifdef __MINGW64__ + extern "C" +#else + static +#endif // __MINGW64__ +inline uint64_t _umul128(uint64_t a, uint64_t b, uint64_t* hi) { unsigned __int128 r = (unsigned __int128)a * (unsigned __int128)b; *hi = r >> 64; diff --git a/minethd.cpp b/minethd.cpp index 59ee6cc5..4fad89ff 100644 --- a/minethd.cpp +++ b/minethd.cpp @@ -33,7 +33,11 @@ void thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id) { +#ifdef __MINGW64__ + SetThreadAffinityMask(&h, 1ULL << cpu_id); +#else SetThreadAffinityMask(h, 1ULL << cpu_id); +#endif // __MINGW64__ } #else #include