Patch from sharkz: Include the <endian.h> header and set the WORDS_BIGENDIAN define according to BYTE_ORDER