Switch to custom byte swapping function.

GCC builtins like __bswap_32 are not portable between versions.