sna: Fix build on older GCC for cpuid()
We need to double check that the features we look for are supported by the compiler before doing so. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
49d9c5e9d4
commit
528dbf9ebb
|
|
@ -31,8 +31,14 @@
|
|||
|
||||
#include "sna.h"
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */
|
||||
|
||||
#include <cpuid.h>
|
||||
|
||||
#ifndef bit_AVX2
|
||||
#define bit_AVX2 (1<<5)
|
||||
#endif
|
||||
|
||||
unsigned sna_cpu_detect(void)
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
|
@ -74,3 +80,12 @@ unsigned sna_cpu_detect(void)
|
|||
|
||||
return features;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
unsigned sna_cpu_detect(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue