HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
win32_error_impl.hpp
1// Copyright Take Vos 2024.
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 "../macros.hpp"
8#include "win32_error_intf.hpp"
9
10hi_export_module(hikogui.win32 : win32_error_impl);
11
12hi_export namespace hi { inline namespace v1 {
13
14[[nodiscard]] inline std::string win32_error_category::message(int code) const
15{
16 if (auto msg = win32_FormatMessage(static_cast<win32_error>(code))) {
17 return *msg;
18
19 } else {
20 throw std::system_error(msg.error());
21 }
22}
23
24}}
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20