If you write it the naive way it works.
uint8_t bytes[4];
uint32_t = bytes[0] << 24 + bytes[1] << 16 + bytes[2] << 8 + bytes[3];
The endianness is whatever you write in the indexing and will be the same across architectures.