In the Plan 9 source code I often find code like this to read serialised data from a buffer with a well-defined endianess:
#include
uint32_
If you want to guaranty a conversions between a native platform order and a defined order (order on a network for example) you can let system libraries to the work and simply use the functions of : hton, htons, htonl and ntoh, ntohs, nthol.
But I must admit that the include file is not guaranteed : under Windows I think it is winsock.h.