diff --git a/src/cpuinfo_x86.c b/src/cpuinfo_x86.c index 18e88c1..ccbe4aa 100644 --- a/src/cpuinfo_x86.c +++ b/src/cpuinfo_x86.c @@ -102,7 +102,6 @@ defined(CPU_FEATURES_OS_FREEBSD) #include "internal/filesystem.h" // Needed to parse /proc/cpuinfo #include "internal/stack_line_reader.h" // Needed to parse /proc/cpuinfo -#include "internal/string_view.h" // Needed to parse /proc/cpuinfo #elif defined(CPU_FEATURES_OS_DARWIN) #if !defined(HAVE_SYSCTLBYNAME) #error "Darwin needs support for sysctlbyname" @@ -112,6 +111,8 @@ #error "Unsupported OS" #endif // CPU_FEATURES_OS +#include "internal/string_view.h" + //////////////////////////////////////////////////////////////////////////////// // Definitions for CpuId and GetXCR0Eax. //////////////////////////////////////////////////////////////////////////////// @@ -1698,11 +1699,10 @@ void FillX86BrandString(char brand_string[49]) { SafeCpuId(max_cpuid_leaf_ext, 0x80000003), SafeCpuId(max_cpuid_leaf_ext, 0x80000004), }; - const size_t leaves_size = sizeof(leaves); #if __STDC_VERSION__ >= 201112L - _Static_assert(leaves_size == 48, "Leaves must be packed"); + _Static_assert(sizeof(leaves) == 48, "Leaves must be packed"); #endif - CpuFeatures_StringView_CopyString(view((const char*)leaves, leaves_size), + CpuFeatures_StringView_CopyString(view((const char*)leaves, sizeof(leaves)), brand_string, 49); }