header_utils
Loading...
Searching...
No Matches
error_context.h
1#pragma once
2
3#include "source_location.h"
4#ifdef __cpp_lib_stacktrace
5#include <stacktrace>
6#endif
7#include <thread>
8
10
11
12namespace ghassanpl
13{
14 intptr_t GetLastSystemError();
15
16 struct error_context
17 {
18 error_context(source_location loc) : loc(loc) {}
19
20 source_location loc;
21#ifdef __cpp_lib_stacktrace
22 std::stacktrace stacktrace = std::stacktrace::current();
23#endif
24 intptr_t errno_value = errno;
25 intptr_t system_error = GetLastSystemError();
26 std::thread::id thread_id = std::this_thread::get_id();
27 };
28
29 struct error_context_datum
30 {
31
32 };
33
34 inline thread_local std::vector<error_context_datum const*> error_context_stack;
35}
36
37
Primary namespace for everything in this library.
Definition align+rec2.h:10