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

Fix bswap use on Android #33

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

lephilousophe
Copy link

Android uses Bionic libc which doesn't provide __bswap_16 nor __bswap_32 (see byteswap.h).
But byteswap.h provides public macros to use.

In addition, avoid using these calls when the compiler provides a builtin function (at least for GCC and Clang).

On Bionic, __bswap_16 and __bswap_32 don't existe. They are named
__swap16 and __swap32.
These symbols are not meant for direct use as byteswap.h exposes
bswap_16 and bswap_32 so let use them instead.
This avoids calls when possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant