From aa0624356b4cffb0db795327c28dd0b88a14f926 Mon Sep 17 00:00:00 2001 From: Stephen Chen Date: Wed, 13 Sep 2017 14:19:14 -0700 Subject: [PATCH] fixing namespacing issue for the dummy non sse crc32c_hw Summary: Because the way the #if was written, the dummy crc32c_hw function accidentally ended in folly namespace instead of folly::details as expected. Fix this. Reviewed By: yfeldblum Differential Revision: D5826187 fbshipit-source-id: ba0f2207a00bc21eda7a727f3f1025e1106d55f9 --- folly/detail/Crc32cDetail.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/folly/detail/Crc32cDetail.cpp b/folly/detail/Crc32cDetail.cpp index 42e5cae7..9dde0419 100644 --- a/folly/detail/Crc32cDetail.cpp +++ b/folly/detail/Crc32cDetail.cpp @@ -40,10 +40,12 @@ #include namespace folly { -namespace crc32_detail { +namespace detail { #if FOLLY_SSE_PREREQ(4, 2) +namespace crc32_detail { + #define CRCtriplet(crc, buf, offset) \ crc##0 = _mm_crc32_u64(crc##0, *(buf##0 + offset)); \ crc##1 = _mm_crc32_u64(crc##1, *(buf##1 + offset)); \ @@ -228,8 +230,6 @@ void triplet_loop( } // namespace crc32c_detail -namespace detail { - /* Compute CRC-32C using the Intel hardware instruction. */ FOLLY_TARGET_ATTRIBUTE("sse4.2") uint32_t crc32c_hw(const uint8_t* buf, size_t len, uint32_t crc) { @@ -281,11 +281,11 @@ uint32_t crc32c_hw(const uint8_t* buf, size_t len, uint32_t crc) { #else -uint32_t -crc32c_hw(const uint8_t* data, size_t nbytes, uint32_t startingChecksum) { +uint32_t crc32c_hw(const uint8_t* buf, size_t len, uint32_t crc) { throw std::runtime_error("crc32_hw is not implemented on this platform"); } #endif -} -} // namespace + +} // namespace detail +} // namespace folly -- 2.34.1