Commit 387cc001 authored by Ondřej Surý's avatar Ondřej Surý Committed by Michał Kępień

Add Solaris support for <isc/endian.h>

While Solaris does not support the nonstandard hto[bl]e{16,32,64}() and
[bl]e{16,32,64}toh() conversion functions, it does have some
byte-swapping macros available in <sys/byteorder.h>.  Ensure these
macros are used in the fallback definitions of the aforementioned
nonstandard functions.
parent 85059c29
......@@ -83,6 +83,19 @@
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __PDP_ENDIAN PDP_ENDIAN
#elif defined(sun) || defined(__sun) || defined(__SVR4)
/*
* For Solaris, rely on the fallback definitions below, though use
* Solaris-specific versions of bswap_{16,32,64}().
*/
# include <sys/byteorder.h>
# define bswap_16(x) BSWAP_16(x)
# define bswap_32(x) BSWAP_32(x)
# define bswap_64(x) BSWAP_64(x)
#else
#endif /* Specific platform support */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment