Skip to content

Commit

Permalink
[Test] Fix getting last error code on old versions of MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Jan 25, 2025
1 parent 3b678a1 commit a464884
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bitexception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ auto bit7z::make_hresult_code( HRESULT res ) noexcept -> std::error_code {
}

auto bit7z::last_error_code() noexcept -> std::error_code {
return std::error_code{ static_cast< int >( GetLastError() ), std::system_category() };
const auto error = static_cast< int >( GetLastError() );
return std::error_code{ error, std::system_category() };
}

using bit7z::BitException;
Expand Down

0 comments on commit a464884

Please sign in to comment.