Index: bswap.h =================================================================== --- bswap.h (revision 5786) +++ bswap.h (working copy) @@ -5,6 +5,12 @@ #include +#ifdef HAVE_MACHINE_BSWAP_H +#include +#include +#include +#else + #ifdef HAVE_BYTESWAP_H #include #else @@ -58,6 +64,8 @@ return bswap_64(x); } +#endif /* ! HAVE_MACHINE_BSWAP_H */ + static inline void bswap16s(uint16_t *s) { *s = bswap16(*s); Index: configure =================================================================== --- configure (revision 5786) +++ configure (working copy) @@ -1222,6 +1233,15 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then echo "#define HAVE_BYTESWAP_H 1" >> $config_h fi + cat > $TMPC << EOF +#include +#include +#include +int main(void) { return bswap32(0); } +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h + fi fi if [ "$openbsd" = "yes" ] ; then