Hacker News new | ask | show | jobs
by 3r1kB 3514 days ago
Yep, unfortunately a universal 'Network-Byte_order'[1] stil doesn't exist.

Things like this were especially a pain with industrial network protocols that we used in our applications during the transition from PowerPC to Intel on OS X. All the CFSwapInt16HostToBig() and CFSwapInt16BigToHost() stuff...

And earlier before I learned about '#pragma packed' it took me a while to find out where all these extra zeroes suddenly came from :-D

[1] https://en.wikipedia.org/wiki/Endianness#Networking