Merged
Conversation
Using the old method in src/sys/unix/selector/mod.rs we needed to define all the targets twice, now we just do it once and set the path to the correct selector implementation. Note that is only possible because we increased MSRV so that it supports the path attribute, when the code was originally written this was not a thing.
The old macro was a mess of not(any(targets...)), means that when porting to a new target you always used the stateless implementation even if you didn't know about it. This fixes gotcha that and moves the logic of what kind of IoSourceState to use to the selector implemtnation files, which means that we don't have to worry about it when porting to a new platform.
Initially I though this would give a nice error message saying that platform X wasn't supported. But due to the amount of other errors the error message is still not great. So, to make porting easier in the future, just remove this and we'll get a `fds` not defined error.
Means we can remove the cfg_io_source! macro usage as that is already done in the selector implementation file.
e63aca9 to
2979ce7
Compare
Darksonn
approved these changes
Jun 21, 2024
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.
The cfg situation in the sys::unix module is messy to say the least. This series of commits aims to clean them up.