Break dependency on byteswap.h
authorOwen Yamauchi <oyamauchi@fb.com>
Fri, 3 May 2013 17:43:36 +0000 (10:43 -0700)
committerSara Golemon <sgolemon@fb.com>
Mon, 20 May 2013 18:01:27 +0000 (11:01 -0700)
commit29ad1ec90ccf41d985a69de6c59f0fde1a9e4502
tree96f5053bc84b9ea6caa855019b80f81d2b3fa056
parentce4dec4c322aee6b9905be54bb67956d76270b65
Break dependency on byteswap.h

Summary:
Unfortunately, this doesn't exist on all platforms. Fortunately, both
gcc and clang support builtins that do the same thing as the bswap_*
functions we were including byteswap.h for.

I changed the test file to hardcode expected results for the swapping
functions. Is that OK? It seemed a little silly to be testing the
Endian::whatever functions by comparing them against the functions that
they're implemented in terms of.

Test Plan:
fbconfig/fbmake runtests with gcc 4.6 and 4.7. Verified
separately that clang supports these builtins.

Reviewed By: simpkins@fb.com

FB internal diff: D799244
folly/Bits.h
folly/configure.ac
folly/test/EndianTest.cpp