Closed vihai closed 7 years ago
If you are writing for a single architecture, then specify either :little
or :big
as appropriate.
In the rare case that you are writing for multiple architectures, then your above workaround is fine.
I am deliberately not supporting endian :native
, as native endian is often a source of bugs. The complicated declaration reminds the reader that it is not a simple as :little
or :big
.
I am writing a pure ruby gem thus I don't know in advance on what architecture it will be run. The NetLink protocol is spoken between userland and the kernel and it uses the native endianness since it is strictly local.
I honestly don't see why you don't want to support these legitimate cases but it's not a big issue, it's just that the workaround is very, very ugly.
Hello,
There are cases, for example the NetLink protocol, that use the native system endianness. It would be convenient to be able to specify a "native" endianness. Now I'm using a workaround like: