Originally cloned from https://gist.github.com/PkmX/63dd23f28ba885be53a5
Commit was: 1eca2ab34f2301b9641aa73d1016b951fff3fc39
Re-published at https://github.com/BenWiederhake/portable-endian.h to provide a means to submit patches and report issues. Turns out, this was pointless.
Currently in use and maintained at: https://github.com/majn/tgl/blob/master/tl-parser/portable_endian.h