Use Windows specific __cpuid() for Windows.
This commit is contained in:
@@ -11,7 +11,9 @@ This provides the PoW hash function for Verus, enabling CPU mining.
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if !XERCES_HAVE_INTRIN_H
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@@ -94,8 +96,16 @@ extern void verus_hash(void *result, const void *data, size_t len);
|
|||||||
inline bool IsCPUVerusOptimized()
|
inline bool IsCPUVerusOptimized()
|
||||||
{
|
{
|
||||||
unsigned int eax,ebx,ecx,edx;
|
unsigned int eax,ebx,ecx,edx;
|
||||||
|
#ifdef _WIN32
|
||||||
|
int CPUInfo[4];
|
||||||
|
CPUInfo[0] = &eax;
|
||||||
|
CPUInfo[1] = &ebx;
|
||||||
|
CPUInfo[2] = &ecx;
|
||||||
|
CPUInfo[3] = &edx;
|
||||||
|
if (!__get_cpuid(CPUInfo, 1))
|
||||||
|
#else
|
||||||
if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx))
|
if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user