diff --git a/src/ciphers/aes/aes_desc.c b/src/ciphers/aes/aes_desc.c index b9d1d5089..1c08c713a 100644 --- a/src/ciphers/aes/aes_desc.c +++ b/src/ciphers/aes/aes_desc.c @@ -15,14 +15,14 @@ #define LTC_S_X86_CPUID static LTC_INLINE void s_x86_cpuid(int* regs, int leaf) { -#if defined _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // MSVC but not ClangCL __cpuid(regs, leaf); #else int a, b, c, d; a = leaf; b = c = d = 0; - asm volatile ("cpuid" + __asm__ volatile ("cpuid" :"=a"(a), "=b"(b), "=c"(c), "=d"(d) :"a"(a), "c"(c) ); diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index 637438a03..1053071b2 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -33,14 +33,14 @@ #define LTC_S_X86_CPUID static LTC_INLINE void s_x86_cpuid(int* regs, int leaf) { -#if defined _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // MSVC but not ClangCL __cpuid(regs, leaf); #else int a, b, c, d; a = leaf; b = c = d = 0; - asm volatile ("cpuid" + __asm__ volatile ("cpuid" :"=a"(a), "=b"(b), "=c"(c), "=d"(d) :"a"(a), "c"(c) ); diff --git a/src/hashes/sha1_desc.c b/src/hashes/sha1_desc.c index 8b83687ea..9eaad2626 100644 --- a/src/hashes/sha1_desc.c +++ b/src/hashes/sha1_desc.c @@ -28,14 +28,14 @@ const struct ltc_hash_descriptor sha1_desc = #define LTC_S_X86_CPUID static LTC_INLINE void s_x86_cpuid(int* regs, int leaf) { -#if defined _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // MSVC but not ClangCL __cpuid(regs, leaf); #else int a, b, c, d; a = leaf; b = c = d = 0; - asm volatile ("cpuid" + __asm__ volatile ("cpuid" :"=a"(a), "=b"(b), "=c"(c), "=d"(d) :"a"(a), "c"(c) ); diff --git a/src/hashes/sha2/sha224_desc.c b/src/hashes/sha2/sha224_desc.c index 6aa9dfd20..3269ff987 100644 --- a/src/hashes/sha2/sha224_desc.c +++ b/src/hashes/sha2/sha224_desc.c @@ -33,14 +33,14 @@ const struct ltc_hash_descriptor sha224_desc = #define LTC_S_X86_CPUID static LTC_INLINE void s_x86_cpuid(int* regs, int leaf) { -#if defined _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // MSVC but not ClangCL __cpuid(regs, leaf); #else int a, b, c, d; a = leaf; b = c = d = 0; - asm volatile ("cpuid" + __asm__ volatile ("cpuid" :"=a"(a), "=b"(b), "=c"(c), "=d"(d) :"a"(a), "c"(c) ); diff --git a/src/hashes/sha2/sha256_desc.c b/src/hashes/sha2/sha256_desc.c index 1bf0c1f7a..02b9b0aa7 100644 --- a/src/hashes/sha2/sha256_desc.c +++ b/src/hashes/sha2/sha256_desc.c @@ -8,14 +8,14 @@ #define LTC_S_X86_CPUID static LTC_INLINE void s_x86_cpuid(int* regs, int leaf) { -#if defined _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // MSVC but not ClangCL __cpuid(regs, leaf); #else int a, b, c, d; a = leaf; b = c = d = 0; - asm volatile ("cpuid" + __asm__ volatile ("cpuid" :"=a"(a), "=b"(b), "=c"(c), "=d"(d) :"a"(a), "c"(c) );