The smallest questions always cause the most heated debate.
It doesn't really matter much how the possible byte order swap is done: what matters that these ifdefs aren't littered around the code and byte-order swapping is limited to the lowest level where data is actually read from an external source.
I would personally go with his byte array reads as it's less confusing but I would still wrap the functionality inside inlined functions like these:
Nice! 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.
It doesn't really matter much how the possible byte order swap is done: what matters that these ifdefs aren't littered around the code and byte-order swapping is limited to the lowest level where data is actually read from an external source.
I would personally go with his byte array reads as it's less confusing but I would still wrap the functionality inside inlined functions like these:
And then use these whenever reading 32-bit integers from big-endian or little-endian data source.