blueloveTH 1 год назад
Родитель
Сommit
7738142985

+ 6 - 0
include/pocketpy/common/utils.hpp

@@ -25,4 +25,10 @@ inline const char* kPlatformStrings[] = {
     "unknown"       // 6
 };
 
+#ifdef _MSC_VER
+#define PK_UNREACHABLE()			__assume(0);
+#else
+#define PK_UNREACHABLE()			__builtin_unreachable();
+#endif
+
 } // namespace pkpy

+ 0 - 12
include/pocketpy/config.h

@@ -68,15 +68,3 @@
     #define PK_PLATFORM_SEP '/'
 #endif
 
-#ifdef _MSC_VER
-#pragma warning (disable:4267)
-#pragma warning (disable:4100)
-#pragma warning (disable:4244)
-#pragma warning (disable:4996)
-#endif
-
-#ifdef _MSC_VER
-#define PK_UNREACHABLE()			__assume(0);
-#else
-#define PK_UNREACHABLE()			__builtin_unreachable();
-#endif

+ 2 - 2
src/interpreter/ceval.cpp

@@ -1043,11 +1043,11 @@ __NEXT_STEP:
         *p = VAR(CAST(i64, *p) - 1);
     } DISPATCH()
     /*****************************************/
-    default: PK_UNREACHABLE();
+    default: PK_UNREACHABLE()
     }
 }
 /**********************************************************************/
-            PK_UNREACHABLE();
+            PK_UNREACHABLE()
         }catch(InternalException internal){
             __internal_exception = internal;
             if(internal.type == InternalExceptionType::Unhandled){

+ 1 - 1
src/interpreter/vm.cpp

@@ -1101,7 +1101,7 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
                     callstack.popx(),
                     ArgsView(__vectorcall_buffer, __vectorcall_buffer + co->nlocals)
                 );
-            default: PK_UNREACHABLE();
+            default: PK_UNREACHABLE()
         };
 
         // simple or normal