Those with the ability to test can add
AC_CHECK_HEADERS(byteswap.h)
to configure.ac, and then check
#ifdef HAVE_BYTESWAP_H
... current code ...
#else
... OSX code ...
#endif
after running ./autogen.sh with proper autoconf/libcurl/etc. build dependencies, to regenerate configure.