Make sure _SC_LEVEL1_DCACHE_LINESIZE is defined

pull/507/head
Deadpikle 2017-09-17 14:20:10 -04:00
parent 7097546cfc
commit 7c12be4f1f
1 changed files with 2 additions and 2 deletions

View File

@ -605,7 +605,7 @@ void DetectArmFeatures()
g_hasSHA1 = CPU_QuerySHA1() || CPU_ProbeSHA1();
g_hasSHA2 = CPU_QuerySHA2() || CPU_ProbeSHA2();
#if defined(__linux__)
#if defined(__linux__) && defined(_SC_LEVEL1_DCACHE_LINESIZE)
g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#endif
@ -726,7 +726,7 @@ void DetectPowerpcFeatures()
#if defined(_AIX)
// /usr/include/sys/systemcfg.h
g_cacheLineSize = getsystemcfg(SC_L1C_DLS);
#elif defined(__linux__)
#elif defined(__linux__) && defined(_SC_LEVEL1_DCACHE_LINESIZE)
// GCC112 CentOS 7 returns 0?
g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#endif