unsigned int val = 1;
return *((unsigned char *)&val);
If a machine is little-endian, 'val' is reversed and stored to a memory. That may be implementation-dependent way. But I think that it isn't problem for specific products, if the library having the check code supports specific type of applications.
Of course, if this value is not cached, we should use const.