[*] wanted to do this for a while

This commit is contained in:
Reece Wilson 2023-03-22 18:11:32 +00:00
parent b8c5239068
commit f1826cc27f
2 changed files with 8 additions and 14 deletions

View File

@ -11,9 +11,6 @@ namespace Aurora::Debug
{
struct ErrorStack;
AUKN_SYM void PushStack(ErrorStack *pStack);
AUKN_SYM void PopStack(ErrorStack *pStack);
struct ErrorStackAccessor;
struct ThreadMessage
@ -31,15 +28,8 @@ namespace Aurora::Debug
struct ErrorStack
{
inline ErrorStack()
{
PushStack(this);
}
inline ~ErrorStack()
{
PopStack(this);
}
AUKN_SYM ErrorStack();
AUKN_SYM ~ErrorStack();
inline bool HasCaptured()
{

View File

@ -56,8 +56,10 @@ namespace Aurora::Debug
static thread_local ErrorStack *tlsErrorStackBase;
AUKN_SYM void PushStack(ErrorStack *pStack)
AUKN_SYM ErrorStack::ErrorStack()
{
auto pStack = this;
if (!tlsErrorStackBase)
{
tlsErrorStackBase = pStack;
@ -74,8 +76,10 @@ namespace Aurora::Debug
dumb.SetNext(itr, pStack);
}
AUKN_SYM void PopStack(ErrorStack *pStack)
AUKN_SYM ErrorStack::~ErrorStack()
{
auto pStack = this;
if (!tlsErrorStackBase)
{
return;