Byte swap functions for platforms that lack them