Browse Source

Core: Use `__fastfail()` in MSVC error macros

Thaddeus Crews 3 months ago
parent
commit
b23a233b5b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      core/error/error_macros.h

+ 5 - 1
core/error/error_macros.h

@@ -34,6 +34,10 @@
 
 
 #include <atomic> // IWYU pragma: keep // Used in macro. We'd normally use `safe_refcount.h`, but that would cause circular includes.
 #include <atomic> // IWYU pragma: keep // Used in macro. We'd normally use `safe_refcount.h`, but that would cause circular includes.
 
 
+#ifdef _MSC_VER
+#include <intrin.h> // `__fastfail()`.
+#endif
+
 class String;
 class String;
 class ObjectID;
 class ObjectID;
 
 
@@ -85,7 +89,7 @@ void _physics_interpolation_warning(const char *p_function, const char *p_file,
 /**
 /**
  * Don't use GENERATE_TRAP() directly, should only be used be the macros below.
  * Don't use GENERATE_TRAP() directly, should only be used be the macros below.
  */
  */
-#define GENERATE_TRAP() __debugbreak()
+#define GENERATE_TRAP() __fastfail(7 /* FAST_FAIL_FATAL_APP_EXIT */)
 #else
 #else
 /**
 /**
  * Don't use GENERATE_TRAP() directly, should only be used be the macros below.
  * Don't use GENERATE_TRAP() directly, should only be used be the macros below.