diff options
Diffstat (limited to 'src/error.cpp')
-rw-r--r-- | src/error.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <windows.h> +#include <cstdint> #include <sstream> #include <string> #include <system_error> @@ -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<int>(code), category_windows(), build_what(code, function)}; + static_cast<int32_t>(code), category_windows(), build_what(code, function)}; } } // namespace error |