0031483: Configuration - __asm keyword not supported on ARM within Windows target
authorkgv <kgv@opencascade.com>
Thu, 2 Apr 2020 12:38:46 +0000 (15:38 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 10 Apr 2020 14:41:38 +0000 (17:41 +0300)
_M_IX86 is now checked before using _asm fot TBB workaround.

src/Standard/Standard.cxx

index 6d300ad..a188ff1 100644 (file)
@@ -101,14 +101,14 @@ Standard_MMgrFactory::Standard_MMgrFactory()
   aVar = getenv ("MMGT_OPT");
   Standard_Integer anAllocId   = (aVar ?  atoi (aVar): OCCT_MMGT_OPT_DEFAULT);
 
-#if defined(_WIN32) && !defined(_WIN64) && !defined(__MINGW32__)
-  static const DWORD _SSE2_FEATURE_BIT(0x04000000);
-  if ( anAllocId == 2 )
+#if defined(HAVE_TBB) && defined(_M_IX86)
+  if (anAllocId == 2)
   {
-    // CR25396: Check if SSE2 instructions are supported, if not then use MMgrRaw
-    // instead of MMgrTBBalloc. It is to avoid runtime crash when running on a 
-    // CPU that supports SSE but does not support SSE2 (some modifications of
-    // AMD Sempron).
+    // CR25396: Check if SSE2 instructions are supported on 32-bit x86 processor on Windows platform,
+    // if not then use MMgrRaw instead of MMgrTBBalloc.
+    // It is to avoid runtime crash when running on a CPU
+    // that supports SSE but does not support SSE2 (some modifications of AMD Sempron).
+    static const DWORD _SSE2_FEATURE_BIT(0x04000000);
     DWORD volatile dwFeature;
     _asm
     {