Extending endian code to work on i386 and x86-64