Prevent xxhash symbols from polluting global namespace

Summary:
The functions and global symbols in xxhash.h and xxhash.cc were not in any namespace.
This caused issues when rocksdb library was being used along with other uses of libraries
with the same name

Test Plan:
unit tests

Reviewers:

CC:

Task ID: #

Blame Rev:
main
Sameet Agarwal 10 years ago
parent 53996149d4
commit 3ebebfccd8
  1. 3
      util/xxhash.cc
  2. 4
      util/xxhash.h

@ -92,6 +92,7 @@ FORCE_INLINE void XXH_free (void* p) { free(p); }
FORCE_INLINE void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
namespace rocksdb {
//**************************************
// Basic Types
//**************************************
@ -473,3 +474,5 @@ U32 XXH32_digest (void* state_in)
return h32;
}
} // namespace rocksdb

@ -60,7 +60,7 @@ It depends on successfully passing SMHasher test set.
#pragma once
#if defined (__cplusplus)
extern "C" {
namespace rocksdb {
#endif
@ -160,5 +160,5 @@ To free memory context, use XXH32_digest(), or free().
#if defined (__cplusplus)
}
} // namespace rocksdb
#endif

Loading…
Cancel
Save