TinyEXIF icon indicating copy to clipboard operation
TinyEXIF copied to clipboard

Add support for big-endian CPUs

Open marcoffee opened this issue 3 years ago • 2 comments
trafficstars

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.

marcoffee avatar Jan 07 '22 20:01 marcoffee

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?

cdcseacave avatar Jan 08 '22 10:01 cdcseacave

@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.

marcoffee avatar Jan 10 '22 12:01 marcoffee