From b845c8bfc80a261fe071ef2049b57a7f8a8ee659 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 7 Nov 2022 16:34:26 +1000 Subject: [PATCH] SP int: support mingw64 again Check for _MSC_VER to determine that we are compiling for MSVC. --- wolfcrypt/src/sp_int.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 8a1d125fa..f86081e17 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -288,7 +288,7 @@ This library provides single precision (SP) integer math functions. * CPU: x86_64 */ -#ifndef _WIN64 +#ifndef _MSC_VER /* Multiply va by vb and store double size result in: vh | vl */ #define SP_ASM_MUL(vl, vh, va, vb) \ __asm__ __volatile__ ( \ @@ -576,7 +576,8 @@ This library provides single precision (SP) integer math functions. while (0) #endif -#if !defined(WOLFSSL_SP_DIV_WORD_HALF) && (!defined(_WIN64) || _MSC_VER >= 1920) +#if !defined(WOLFSSL_SP_DIV_WORD_HALF) && (!defined(_MSC_VER) || \ + _MSC_VER >= 1920) /* Divide a two digit number by a digit number and return. (hi | lo) / d * * Using divq instruction on Intel x64. @@ -589,7 +590,7 @@ This library provides single precision (SP) integer math functions. static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, sp_int_digit d) { -#ifndef _WIN64 +#ifndef _MSC_VER __asm__ __volatile__ ( "divq %2" : "+a" (lo)