From 6845df16333e7504abd7cceb2b5cb4e7637c73fb Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 4 May 2021 16:11:03 +0300 Subject: move away from variable-size ints --- src/error.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/error.cpp') diff --git a/src/error.cpp b/src/error.cpp index ff755b6..d0c8a53 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -29,7 +30,7 @@ std::string build_what(DWORD code, const char* function) { return what.str(); } -std::string format_message(int code) { +std::string format_message(int32_t code) { wchar_t* buf; const auto len = ::FormatMessageW( @@ -53,14 +54,14 @@ std::string format_message(int code) { } // namespace -std::string CategoryWindows::message(int code) const { +std::string CategoryWindows::message(int32_t code) const { return format_message(code); } std::system_error windows(DWORD code, const char* function) { - static_assert(sizeof(DWORD) == sizeof(int), "Aren't DWORDs the same size as ints?"); + static_assert(sizeof(DWORD) == sizeof(int32_t), "Aren't DWORDs the same size as ints?"); return std::system_error{ - static_cast(code), category_windows(), build_what(code, function)}; + static_cast(code), category_windows(), build_what(code, function)}; } } // namespace error -- cgit v1.2.3