#include <folly/detail/BitIteratorDetail.h>
#include <folly/Likely.h>
-#if FOLLY_HAVE_BYTESWAP_H
-# include <byteswap.h>
-#endif
-
#include <cassert>
#include <cinttypes>
#include <iterator>
static T swap(T x);
};
-#ifndef _MSC_VER
-
-/**
- * If we have the bswap_16 macro from byteswap.h, use it; otherwise, provide our
- * own definition.
- */
-#ifdef bswap_16
-# define our_bswap16 bswap_16
-#else
-
-template<class Int16>
-inline constexpr typename std::enable_if<
- sizeof(Int16) == 2,
- Int16>::type
-our_bswap16(Int16 x) {
- return ((x >> 8) & 0xff) | ((x & 0xff) << 8);
-}
-#endif
-
-#endif
-
#define FB_GEN(t, fn) \
template <> \
inline t EndianIntBase<t>::swap(t x) { \
}
// fn(x) expands to (x) if the second argument is empty, which is exactly
-// what we want for [u]int8_t. Also, gcc 4.7 on Intel doesn't have
-// __builtin_bswap16 for some reason, so we have to provide our own.
+// what we want for [u]int8_t.
FB_GEN( int8_t,)
FB_GEN(uint8_t,)
#ifdef _MSC_VER
FB_GEN(uint64_t, __builtin_bswap64)
FB_GEN( int32_t, __builtin_bswap32)
FB_GEN(uint32_t, __builtin_bswap32)
-FB_GEN( int16_t, our_bswap16)
-FB_GEN(uint16_t, our_bswap16)
+FB_GEN( int16_t, __builtin_bswap16)
+FB_GEN(uint16_t, __builtin_bswap16)
#endif
#undef FB_GEN
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h features.h inttypes.h limits.h sched.h stdint.h stdlib.h string.h sys/time.h unistd.h mutex.h malloc.h byteswap.h bits/functexcept.h bits/c++config.h])
+AC_CHECK_HEADERS([fcntl.h features.h inttypes.h limits.h sched.h stdint.h stdlib.h string.h sys/time.h unistd.h mutex.h malloc.h bits/functexcept.h bits/c++config.h])
AC_CHECK_HEADER(double-conversion/double-conversion.h, [], [AC_MSG_ERROR(
[Couldn't find double-conversion.h, please download from \