Created
June 10, 2012 19:49
-
-
Save hellertime/2907111 to your computer and use it in GitHub Desktop.
Autoconf fragment for normalizing byte-swap functions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AH_VERBATIM([PORTABLE_BYTE_SWAP_FUNCTIONS], | |
[/* Standardize on a byte-swap function naming */ | |
#if defined(__linux__) | |
# include <endian.h> | |
#elif defined(__FreeBSD__) || defined(__NetBSD__) | |
# include <sys/endian.h> | |
#elif defined(__OpenBSD__) | |
# include <sys/types.h> | |
# define be16toh(x) betoh16(x) | |
# define be32toh(x) betoh32(x) | |
# define be64toh(x) betoh64(x) | |
#else | |
# error No suitable byte-swap routines were found | |
#endif]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment