@@ -73,12 +73,10 @@ static uint32 UNALIGNED_LOAD32(const char *p) {
7373
7474#endif // __BIG_ENDIAN__
7575
76- #if !defined(LIKELY)
7776#if defined(__GNUC__) || defined(__INTEL_COMPILER)
78- #define LIKELY (x ) (__builtin_expect(!!(x), 1 ))
77+ #define MY_LIKELY (x ) (__builtin_expect(!!(x), 1 ))
7978#else
80- #define LIKELY (x ) (x)
81- #endif
79+ #define MY_LIKELY (x ) (x)
8280#endif
8381
8482static uint64 Fetch64 (const char *p) {
@@ -313,7 +311,7 @@ uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed) {
313311 std::swap (z, x);
314312 s += 64 ;
315313 len -= 128 ;
316- } while (LIKELY (len >= 128 ));
314+ } while (MY_LIKELY (len >= 128 ));
317315 x += Rotate (v.first + z, 49 ) * k0;
318316 z += Rotate (w.first , 37 ) * k0;
319317 // If 0 < len < 128, hash up to 4 chunks of 32 bytes each from the end of s.
@@ -432,7 +430,7 @@ static void CityHashCrc256Short(const char *s, size_t len, uint64 *result) {
432430}
433431
434432void CityHashCrc256 (const char *s, size_t len, uint64 *result) {
435- if (LIKELY (len >= 240 )) {
433+ if (MY_LIKELY (len >= 240 )) {
436434 CityHashCrc256Long (s, len, 0 , result);
437435 } else {
438436 CityHashCrc256Short (s, len, result);
@@ -463,3 +461,5 @@ uint128 CityHashCrc128(const char *s, size_t len) {
463461}
464462
465463#endif
464+
465+ undef MY_LIKELY
0 commit comments