Metadata parsing assumes little endian, even for big endian targets
aprilwade opened this issue · 1 comments
aprilwade commented
cpp_macros
assumes little endian when parsing metadata, even when the target is big endian (for example, powerpc-unknown-linux-gnu
). I'd write a PR, but I'm not sure how best to approach solving this. There doesn't seem to be a good way to discover the target from within a proc macro. Maybe it would be better to ensure the metadata is always stored little endian regardless of the platform?
ogoffart commented
I guess one way to do it would be to write something like 0xfeff
in the metadata just after the "magic" part, then read it from the read_metadata
function and if we read 0xfffe0000, then it means it is big endian and we must read all the number form big endian.
It would be great if you can make a PR.