Bug 1448483 - Remove reference and use of ssize_t in CityHash to avoid conflicting definitions in MinGW x64. r=froydnj, a=jcristau
authorTom Ritter <tom@mozilla.com>
Fri, 23 Mar 2018 16:27:49 -0500
changeset 802189 eeedbadc7a25f7989aaa0d9234efbbcfa8486f21
parent 802188 abc0f9a278d696f85fec72b23151ad17a087c3bf
child 802190 d06fb3839361bda1f0c4af69fe6aec7846dc00b4
push id111850
push userbmo:tom@mozilla.com
push dateThu, 31 May 2018 16:41:37 +0000
reviewersfroydnj, jcristau
bugs1448483
milestone60.0.2
Bug 1448483 - Remove reference and use of ssize_t in CityHash to avoid conflicting definitions in MinGW x64. r=froydnj, a=jcristau MozReview-Commit-ID: ErQGSPNk4Bg
other-licenses/nsis/Contrib/CityHash/CityHash.h
other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp
old mode 100644
new mode 100755
--- a/other-licenses/nsis/Contrib/CityHash/CityHash.h
+++ b/other-licenses/nsis/Contrib/CityHash/CityHash.h
@@ -24,12 +24,8 @@
 #endif
 #include <windows.h>
 
 #ifdef CITYHASH_EXPORTS
 #define CITYHASH_API __declspec(dllexport)
 #else
 #define CITYHASH_API __declspec(dllimport)
 #endif
-
-#ifndef ssize_t
-typedef int ssize_t;
-#endif
old mode 100644
new mode 100755
--- a/other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp
+++ b/other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp
@@ -197,23 +197,23 @@ uint64 CityHash64WithSeed(const char *s,
 }
 
 uint64 CityHash64WithSeeds(const char *s, size_t len,
                            uint64 seed0, uint64 seed1) {
   return HashLen16(CityHash64(s, len) - seed0, seed1);
 }
 
 // A subroutine for CityHash128().  Returns a decent 128-bit hash for strings
-// of any length representable in ssize_t.  Based on City and Murmur.
+// of any length representable in an int.  Based on City and Murmur.
 static uint128 CityMurmur(const char *s, size_t len, uint128 seed) {
   uint64 a = Uint128Low64(seed);
   uint64 b = Uint128High64(seed);
   uint64 c = 0;
   uint64 d = 0;
-  ssize_t l = len - 16;
+  int l = len - 16;
   if (l <= 0) {  // len <= 16
     c = b * k1 + HashLen0to16(s, len);
     d = Rotate(a + (len >= 8 ? UNALIGNED_LOAD64(s) : c), 32);
   } else {  // len > 16
     c = HashLen16(UNALIGNED_LOAD64(s + len - 8) + k1, a);
     d = HashLen16(b + len, c + UNALIGNED_LOAD64(s + len - 16));
     a += d;
     do {