Skip to content

Commit 89b37c3

Browse files
authored
Fix build of aesni on msvc
1 parent 5edb54e commit 89b37c3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ciphers/aes/aes_desc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,19 @@ static LTC_INLINE int s_aesni_is_supported(void)
6363
a = 1;
6464
c = 0;
6565

66+
#if defined(_MSC_VER) && !defined(__clang__)
67+
int arr[4];
68+
__cpuidex(arr, a, c);
69+
a = arr[0];
70+
b = arr[1];
71+
c = arr[2];
72+
d = arr[3];
73+
#else
6674
__asm__ volatile ("cpuid"
6775
:"=a"(a), "=b"(b), "=c"(c), "=d"(d)
6876
:"a"(a), "c"(c)
6977
);
78+
#endif
7079

7180
is_supported = ((c >> 19) & 1) && ((c >> 25) & 1);
7281
initialized = 1;

0 commit comments

Comments
 (0)