modified endianess check based on GCC 6.3.x