Make portable_endian.h more portable.

Add a minimal amount of stuff so we can compile on Solaris 11.

Fixes (sort of) #191.