Fixed cpuid reported supported on unsupported compilers
Former-commit-id: 4f5fc2251882ae04d9131242d0f9d7f8a3a3e6dc
This commit is contained in:
@@ -37,10 +37,10 @@ unsigned int NzHardwareInfoImpl::GetProcessorCount()
|
||||
|
||||
bool NzHardwareInfoImpl::IsCpuidSupported()
|
||||
{
|
||||
#if defined(NAZARA_COMPILER_MSVC)
|
||||
#ifdef NAZARA_PLATFORM_x64
|
||||
return true; // Toujours supporté sur un processeur 64 bits
|
||||
#else
|
||||
#if defined(NAZARA_COMPILER_MSVC)
|
||||
int supported;
|
||||
__asm
|
||||
{
|
||||
@@ -59,7 +59,11 @@ bool NzHardwareInfoImpl::IsCpuidSupported()
|
||||
};
|
||||
|
||||
return supported != 0;
|
||||
#endif // NAZARA_PLATFORM_x64
|
||||
#elif defined(NAZARA_COMPILER_CLANG) || defined(NAZARA_COMPILER_GCC) || defined(NAZARA_COMPILER_INTEL)
|
||||
#ifdef NAZARA_PLATFORM_x64
|
||||
return true; // Toujours supporté sur un processeur 64 bits
|
||||
#else
|
||||
int supported;
|
||||
asm volatile (" pushfl\n"
|
||||
" pop %%eax\n"
|
||||
@@ -78,8 +82,8 @@ bool NzHardwareInfoImpl::IsCpuidSupported()
|
||||
: "eax", "ecx", "memory"); // clobbered register
|
||||
|
||||
return supported != 0;
|
||||
#endif // NAZARA_PLATFORM_x64
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user