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 support for big-endian CPUs #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcoffee
Copy link

Added support for compiling / running on big-endian CPUs.

To solve this problem, I simply added a check if the current computer is little endian and inverted the results of alignIntel in case the CPU is big-endian.

@cdcseacave
Copy link
Owner

your change looks good, but I am not convinced it is following the standard where it is placed; more exact, the format already supports little/big endian, as you can see represented either by I or M, and from what I understand I represents little, and not variable endian; can you pls share the document where this is saying that can be both true and false for I?

@marcoffee
Copy link
Author

@cdcseacave if one tries to compile the code on a big-endian CPU, as the code is now, it would invert the integers.
What I just did is to detect the endianess of the current architecture and only invert the data read if necessary.

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.

2 participants