Refactor Win32Error to use std::system_error#919
Merged
UE4SS merged 6 commits intoUE4SS-RE:mainfrom Aug 19, 2025
Merged
Conversation
Collaborator
|
Any particular reason why this is a draft ? What's still to be done ? |
Contributor
Author
|
It was a draft while I was making the PR for UEPseudo and then I forgot to change it |
DEFAULT_ERROR_CATEGORY macro was creating std::error_category objects on certain uses and polluting global namespace. Replaced with inline function that returns a reference to the proper category singleton. - Replace DEFAULT_ERROR_CATEGORY macro with default_error_category() - HRESULT macro -> type alias (prevents Windows.h conflicts) - Removed redundant null checks on m_error_category - Added noexcept where applicable for optimization - Added PlatformResultCode typedef for future crossplatform codes
UE4SS
requested changes
Jul 1, 2025
Collaborator
UE4SS
left a comment
There was a problem hiding this comment.
Should be good to merge after this if it's been tested and is working.
|
|
||
| namespace RC | ||
| { | ||
| inline const std::error_category& default_error_category() noexcept |
Collaborator
There was a problem hiding this comment.
Suggested change
| inline const std::error_category& default_error_category() noexcept | |
| inline auto default_error_category() noexcept -> const std::error_category& |
Contributor
Author
There was a problem hiding this comment.
My Windows installation is borked at the moment. I'll try to rerun the unit tests asap.
Contributor
Author
There was a problem hiding this comment.
Test suite is all OK.
UE4SS
previously approved these changes
Aug 19, 2025
UE4SS
approved these changes
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactored the Win32Error class to use std::system_error to avoid platform-specific code
Continuation of #902
Type of change
How has this been tested?
I wrote unit tests to ensure the modification doesn't cause any regression
Checklist
https://github.com/Re-UE4SS/UEPseudo/pull/140 depends on this