1 diff --git a/base/third_party/cityhash/city.cc b/base/third_party/cityhash/city.cc 2 index b0d2294aabb3..2ab3db20f4fa 100644 3 --- a/base/third_party/cityhash/city.cc 4 +++ b/base/third_party/cityhash/city.cc 5 @@ -35,7 +35,14 @@ 6 using std::make_pair; 7 using std::pair; 8 9 -#ifdef _MSC_VER 10 +#if defined(__clang__) 11 + 12 +// Use builtins where possible. On Windows for instance, this may prevent a 13 +// function call instead of emitting a single instruction. 14 +#define bswap_32(x) __builtin_bswap32(x) 15 +#define bswap_64(x) __builtin_bswap64(x) 16 + 17 +#elif _MSC_VER 18 19 #include <stdlib.h> 20 #define bswap_32(x) _byteswap_ulong(x)