Backed out changeset 30dec3c6ac99 (bug 1468544) for breaking at least MSVC build. CLOSED TREE

This commit is contained in:
Sebastian Hengst 2018-11-01 20:31:40 +02:00
Родитель ff6d766102
Коммит 4e8b420d03
4 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -8,12 +8,25 @@
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include "city.h"
#include "mar_private.h"
#include "mar.h"
#ifdef XP_WIN
#include <winsock2.h>
#else
#include <netinet/in.h>
#endif
/* this is the same hash algorithm used by nsZipArchive.cpp */
static uint32_t mar_hash_name(const char *name) {
return CityHash64(name, strlen(name)) % TABLESIZE;
uint32_t val = 0;
unsigned char* c;
for (c = (unsigned char *) name; *c; ++c)
val = val*37 + *c;
return val % TABLESIZE;
}
static int mar_insert_item(MarFile *mar, const char *name, int namelen,

Просмотреть файл

@ -24,10 +24,6 @@ UNIFIED_SOURCES += [
'mar_read.c',
]
LOCAL_INCLUDES += [
'../../../other-licenses/nsis/Contrib/CityHash/cityhash',
]
FORCE_STATIC_LIB = True
if CONFIG['OS_ARCH'] == 'WINNT':

Просмотреть файл

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
HOST_SOURCES += [
'/other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp',
'mar.c',
]

Просмотреть файл

@ -50,7 +50,6 @@ typedef uint8_t uint8;
typedef uint32_t uint32;
typedef uint64_t uint64;
#ifdef __cplusplus
// The standard <utility> header doesn't compile, apparently it conflicts
// with... some Mozilla something or other. But all that's used from it
// is std::pair, so we can just replace that with mozilla::Pair.
@ -66,8 +65,6 @@ inline uint64 Uint128Low64(const uint128& x) { return x.first(); }
inline uint64 Uint128High64(const uint128& x) { return x.second(); }
#endif
extern "C" {
#endif
// Hash function for a byte array.
uint64 CityHash64(const char *buf, size_t len);
@ -81,8 +78,6 @@ uint64 CityHash64WithSeed(const char *buf, size_t len, uint64 seed);
uint64 CityHash64WithSeeds(const char *buf, size_t len,
uint64 seed0, uint64 seed1);
#ifdef __cplusplus
}
// Hash function for a byte array.
uint128 CityHash128(const char *s, size_t len);
@ -102,6 +97,5 @@ inline uint64 Hash128to64(const uint128& x) {
b *= kMul;
return b;
}
#endif
#endif // CITY_HASH_H_