Skip to content

Commit

Permalink
Prevent xxhash symbols from polluting global namespace
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
asameet committed Mar 12, 2015
1 parent 5399614 commit 3ebebfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions util/xxhash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
//**************************************
Expand Down Expand Up @@ -473,3 +474,5 @@ U32 XXH32_digest (void* state_in)

return h32;
}

} // namespace rocksdb
4 changes: 2 additions & 2 deletions util/xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ It depends on successfully passing SMHasher test set.
#pragma once

#if defined (__cplusplus)
extern "C" {
namespace rocksdb {
#endif


Expand Down Expand Up @@ -160,5 +160,5 @@ To free memory context, use XXH32_digest(), or free().


#if defined (__cplusplus)
}
} // namespace rocksdb
#endif

0 comments on commit 3ebebfc

Please sign in to comment.