mirror of
https://git.tukaani.org/xz.git
synced 2026-02-25 21:38:06 +00:00
liblzma/MSVC: Add a cast to fix a warning (C4057) with __cpuid()
__cpuid from MSVC (and also the old Intel ICC) use int[], while __get_cpuid from <cpuid.h> in GCC and Clang use unsigned int[]. Adding a cast is the simplest fix. Link: https://github.com/tukaani-project/xz/pull/208
This commit is contained in:
parent
b51d67f4a9
commit
b0f3b64a25
@ -344,7 +344,7 @@ is_arch_extension_supported(void)
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
// This needs <intrin.h> with MSVC. ICC has it as a built-in
|
// This needs <intrin.h> with MSVC. ICC has it as a built-in
|
||||||
// on all platforms.
|
// on all platforms.
|
||||||
__cpuid(r, 1);
|
__cpuid((int *)r, 1);
|
||||||
#elif defined(HAVE_CPUID_H)
|
#elif defined(HAVE_CPUID_H)
|
||||||
// Compared to just using __asm__ to run CPUID, this also checks
|
// Compared to just using __asm__ to run CPUID, this also checks
|
||||||
// that CPUID is supported and saves and restores ebx as that is
|
// that CPUID is supported and saves and restores ebx as that is
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user