Add compatible layer for endian functions on mac