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

Make endianness detection more portable #123

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Commits on Jan 18, 2022

  1. Make endianness detection more portable

    The current check for endianness fails on platforms using newlib as the
    C library, because it provides <machine/endian.h> not <endian.h>. This
    could be fixed by adding `|| defined(__NEWLIB__)` to the check for
    targets that provide <machine/endian.h> (i.e. BSD-like targets).
    
    A more portable solution is to just check if the compiler has already
    defined the necessary macros (which is true for GCC and Clang and Intel,
    at least). Then no header is needed, and it works for platforms that
    aren't explicitly listed in the conditionals.
    jwakely committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    61f4840 View commit details
    Browse the repository at this point in the history