4 ms·
I've tried to tackle this issue at https://github.com/alexchamberlain/byte-order https://github.com/alexchamberlain/byte-order.
by alexchamberlain 15y ago
I've tried to tackle this issue at https://github.com/alexchamberlain/byte-order https://github.com/alexchamberlain/byte-order.
- dchest 15y agoYou did this to prove Pike's argument, didn't you? Whenever I see code that asks what the native byte order is, the odds are about a hundred to one the code is either wrong or misguided. https://github.com/alexchamberlain/byte-order/commit/b804361636f9233a6c9b0b38b04ceef98f3e8faa#L0L64 https://github.com/alexchamberlain/byte-order/commit/b804361...
- alexchamberlain 15y agoWell caught!
- haberman 15y agoNice! I think I'll use this. I was going to suggest also including calls to platform-specific byte swapping functions for compilers other than GCC, but maybe it's better to wait until it's actually demonstrated to be a benefit.
- alexchamberlain 15y agoI'll quite happily optimise it to work with other compilers... Anything bar x86 might be a problem though...