mirror of
https://github.com/google/cpu_features.git
synced 2025-07-03 14:13:18 +02:00
Missing `string_view` header and invalid `_Static_assert` statement
This commit is contained in:

committed by
GitHub

parent
cf589a2844
commit
769287c384
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user