/* * 判断运行环境是否为小端 */ static const int endianTest = 1; #define IsLittleEndian() (*(char *)&endianTest == 1)
函数宏判断小端
原文:http://www.cnblogs.com/liubaocheng999/p/3540366.html