mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
Fix build of aesni on msvc
This commit is contained in:
parent
5edb54e522
commit
89b37c3606
1 changed files with 9 additions and 0 deletions
|
|
@ -63,10 +63,19 @@ static LTC_INLINE int s_aesni_is_supported(void)
|
|||
a = 1;
|
||||
c = 0;
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
int arr[4];
|
||||
__cpuidex(arr, a, c);
|
||||
a = arr[0];
|
||||
b = arr[1];
|
||||
c = arr[2];
|
||||
d = arr[3];
|
||||
#else
|
||||
__asm__ volatile ("cpuid"
|
||||
:"=a"(a), "=b"(b), "=c"(c), "=d"(d)
|
||||
:"a"(a), "c"(c)
|
||||
);
|
||||
#endif
|
||||
|
||||
is_supported = ((c >> 19) & 1) && ((c >> 25) & 1);
|
||||
initialized = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue