1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-05 18:51:53 +00:00

Handle assertions as runtime errors

This commit is contained in:
momo5502
2022-04-05 18:17:29 +02:00
parent 970c9571b2
commit 1f986d5588
2 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,17 @@
#pragma once
#ifdef ASSERT
#undef ASSERT
#endif
#define ASSERT( exp ) if(!(exp)) throw std::runtime_error("Assertion failed: " STRINGIFY(exp))
#ifdef NT_ASSERT
#undef NT_ASSERT
#endif
#define NT_ASSERT( exp ) ASSERT( exp )
namespace std
{
class exception