HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
check.hpp
1
// Copyright Take Vos 2020.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "exception.hpp"
8
#include "utils.hpp"
9
10
namespace
tt {
11
12
#define tt_parse_check(expression, message, ...) \
13
do { \
14
if (!(expression)) { \
15
throw ::tt::parse_error(message __VA_OPT__(,) __VA_ARGS__); \
16
} \
17
} while (false)
18
19
#define tt_hresult_check(expression) \
20
([](HRESULT result) { \
21
if (FAILED(result)) { \
22
throw ::tt::io_error("Call to '{}' failed with {:08x}", #expression, result); \
23
} \
24
return result; \
25
}(expression))
26
27
}
Generated on Mon Apr 22 2024 12:53:30 for HikoGUI by
1.10.0