Skip to content

druntime, posix: Add bindings for POSIX endian.h - #21644

Merged
thewilsonator merged 1 commit into
dlang:masterfrom
ibuclaw:endian_bindings
Aug 4, 2025
Merged

druntime, posix: Add bindings for POSIX endian.h#21644
thewilsonator merged 1 commit into
dlang:masterfrom
ibuclaw:endian_bindings

Conversation

@ibuclaw

@ibuclaw ibuclaw commented Aug 3, 2025

Copy link
Copy Markdown
Member

This is part of the IEEE Std 1003.1 Issue 8

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/endian.h.html

On a spot check of OS's, amongst Linux, OSX and *BSDs, many already had these in endian.h prior to it becoming standard.

Of those which have omissions to the spec:

  • OSX 12 doesn't define the hto*, be*, and le* macros
  • Solaris 11.4 doesn't have the header at all.

But that doesn't matter as this is meant to be a macro-only header, and the implementation is obvious for all platforms.

@ibuclaw ibuclaw added the Druntime Specific to druntime label Aug 3, 2025
@dlang-bot

Copy link
Copy Markdown

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#21644"

This is part of the IEEE Std 1003.1 Issue 8

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/endian.h.html

On a spot check of OS's, amongst Linux, OSX and *BSDs, many already had
these in `endian.h` prior to it becoming standard.

Of those which have omissions to the spec:
- OSX 12 doesn't define the `hto*`, `be*`, and `le*` macros
- Solaris 11.4 doesn't have the header at all.

But that doesn't matter as this is meant to be a macro-only header, and
the implementation is obvious for all platforms.
Comment thread druntime/src/core/sys/posix/endian.d
@thewilsonator
thewilsonator merged commit 026d3f4 into dlang:master Aug 4, 2025
41 of 43 checks passed
@ibuclaw
ibuclaw deleted the endian_bindings branch August 4, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Druntime Specific to druntime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants