Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add htonl, htons, ntohl, ntohs #3669

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Add htonl, htons, ntohl, ntohs #3669

merged 1 commit into from
Aug 16, 2024

Conversation

safinaskar
Copy link

Not a breaking change

@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@safinaskar safinaskar force-pushed the htons branch 3 times, most recently from a3a9105 to 53b30d1 Compare April 28, 2024 21:06
@safinaskar safinaskar marked this pull request as draft April 28, 2024 21:06
@safinaskar safinaskar force-pushed the htons branch 7 times, most recently from c6f1626 to df4b69d Compare April 30, 2024 18:39
@safinaskar safinaskar marked this pull request as ready for review April 30, 2024 20:52
Comment on lines +1371 to +1372
// It seems htonl, etc are macros on macOS. So we have to reimplement them. So let's
// reimplement them for all UNIX platforms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could split the declaration for that target.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could split the declaration for that target

@JohnTitor , yes, we can. But I think this is slightly more error-prone than my approach. I. e. if we split the declaration, then it is possible we introduce bug for some platform, but not for others

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally agree with JohnTitor here that most things should just use the host functions if available, concerns about bugs on one platform but not others isn't much of a concern when one of those platforms uses the system functions.

However, these are also straightforward enough that it doesn't seem worth the effort to split. So I think this is okay.

@tgross35 tgross35 added this pull request to the merge queue Aug 16, 2024
@tgross35 tgross35 changed the title [libc 1.0] Add htonl, htons, ntohl, ntohs Add htonl, htons, ntohl, ntohs Aug 16, 2024
Merged via the queue into rust-lang:main with commit 46e3178 Aug 16, 2024
41 checks passed
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Nov 17, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3669>)
(cherry picked from commit 1feb354)
@tgross35 tgross35 mentioned this pull request Nov 18, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3669>)
(cherry picked from commit 1feb354)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3669>)
(cherry picked from commit 1feb354)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3669>)
(cherry picked from commit 1feb354)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants