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

Replace LibC.ntohs and htons with native code #13027

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Jan 29, 2023

Originally Crystal already uses the byteswap intrinsic on Dragonfly BSD, because its C library doesn't export ntohs and htons, but those functions are so simple in the first place that we can do it ourselves on every other platform as well.

The LibC bindings themselves are intentionally left untouched.

@straight-shoota straight-shoota added this to the 1.8.0 milestone Jan 29, 2023
@straight-shoota straight-shoota merged commit bc01989 into crystal-lang:master Jan 30, 2023
@HertzDevil HertzDevil deleted the refactor/native-ntohs-htons branch January 30, 2023 20:46
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants