Use _M_IX86 and _M_X64 to indicate MSVC x86/x64

_WIN32 is defined on ARM MinGW as well, which breaks current assumptions
This commit is contained in:
driver1998
2019-03-20 02:00:12 +08:00
parent a7ae71c41e
commit fecbec13cf
6 changed files with 12 additions and 12 deletions

View File

@@ -96,7 +96,7 @@ static int host_cpu_features(void)
static int features = 0;
static int features_detected = 0;
/* 32-bit only */
#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32))
#if defined(__i386__) || (defined(_MSC_VER) && defined(_M_IX86))
unsigned long temp1, temp2;
#endif
@@ -104,7 +104,7 @@ static int host_cpu_features(void)
return features;
features_detected = 1;
#if defined(_MSC_VER) && defined(_WIN32) /* MSVC compatible assembly appropriate for 32-bit Windows */
#if defined(_MSC_VER) && defined(_M_IX86) /* MSVC compatible assembly appropriate for 32-bit Windows */
/* see if we are dealing with a cpu that has the cpuid instruction */
__asm {
pushf
@@ -127,7 +127,7 @@ static int host_cpu_features(void)
:
: "eax");
#endif
#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32))
#if defined(__i386__) || (defined(_MSC_VER) && defined(_M_IX86))
temp1 &= 0x200000;
temp2 &= 0x200000;
if (temp1 == temp2) {