bswap_32() is a function specific to Linux, unavailable on FreeBSD and OS X. Instead of messing with other platform specific functions, #ifdef and so on provide a fast inline implementation.