HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
assert.hpp
1// Copyright 2019 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/Foundation/os_detect.hpp"
7#include "TTauri/Foundation/debugger.hpp"
8#include <exception>
9
10namespace tt {
11
12#if TT_BUILD_TYPE == TT_BT_RELEASE
13#define tt_no_default tt_unreachable();
14#else
15#define tt_no_default debugger_abort("tt_no_default");
16#endif
17
18#define tt_not_implemented debugger_abort("tt_not_implemented");
19#define tt_overflow debugger_abort("overflow");
20
24#define tt_assert(expression)\
25 do {\
26 if (tt_unlikely(!(expression))) {\
27 debugger_abort(# expression);\
28 }\
29 } while (false)
30
31}