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:
This commit is contained in:
Sameet Agarwal 2015-03-11 18:00:57 -07:00
parent 53996149d4
commit 3ebebfccd8
2 changed files with 5 additions and 2 deletions

View File

@ -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); } FORCE_INLINE void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
namespace rocksdb {
//************************************** //**************************************
// Basic Types // Basic Types
//************************************** //**************************************
@ -473,3 +474,5 @@ U32 XXH32_digest (void* state_in)
return h32; return h32;
} }
} // namespace rocksdb

View File

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