aboutsummaryrefslogtreecommitdiff
path: root/src/win/Exception.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-12 23:13:10 +0800
committerGitHub <noreply@github.com>2022-01-12 23:13:10 +0800
commit276ae73fa444c16f34a379ae9d8f58c883056b4a (patch)
tree96f4d7103976836e918b4fa1db0fdbb80777986e /src/win/Exception.cpp
parent01f98ce88950cdb729f5db58bf26f2fffa1c326c (diff)
parent65c799c5339ba37bea2217b168e96b15aceaef85 (diff)
downloadcru-276ae73fa444c16f34a379ae9d8f58c883056b4a.tar.gz
cru-276ae73fa444c16f34a379ae9d8f58c883056b4a.tar.bz2
cru-276ae73fa444c16f34a379ae9d8f58c883056b4a.zip
Merge pull request #44 from crupest/dev
Windows development.
Diffstat (limited to 'src/win/Exception.cpp')
-rw-r--r--src/win/Exception.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/win/Exception.cpp b/src/win/Exception.cpp
index df2103fd..2664b092 100644
--- a/src/win/Exception.cpp
+++ b/src/win/Exception.cpp
@@ -1,6 +1,5 @@
#include "cru/win/Exception.hpp"
-#include <fmt/format.h>
#include <optional>
namespace cru::platform::win {
@@ -8,10 +7,9 @@ namespace cru::platform::win {
inline String HResultMakeMessage(HRESULT h_result,
std::optional<String> message) {
if (message.has_value())
- return fmt::format(FMT_STRING(L"HRESULT: {:#08x}. Message: {}"), h_result,
- message->WinCStr());
+ return Format(u"HRESULT: {}. Message: {}", h_result, message->WinCStr());
else
- return fmt::format(FMT_STRING(L"HRESULT: {:#08x}."), h_result);
+ return Format(u"HRESULT: {}.", h_result);
}
HResultError::HResultError(HRESULT h_result)
@@ -26,8 +24,8 @@ HResultError::HResultError(HRESULT h_result,
h_result_(h_result) {}
inline String Win32MakeMessage(DWORD error_code, String message) {
- return fmt::format(L"Last error code: {:#04x}.\nMessage: {}\n", error_code,
- message.WinCStr());
+ return Format(u"Last error code: {}.\nMessage: {}\n", error_code,
+ message.WinCStr());
}
Win32Error::Win32Error(std::string_view message)