直接上代码 typedef union uEndianTest { struct { bool flittle_endian; bool fill[3]; }; long value; } EndianTest; static const EndianTest __Endian_Test__ = { (long)1 }; const bool platform_little_endian = __Endian_Test__.flittle_endian;