cmake: fix path to FindGLog.cmake
[folly.git] / folly / Fingerprint.h
index a4400d5ddcb5eb54ce13724e9a77cd3c9db1c30f..9cf0f5073c1bf35686c4abd0eb77e9d86872172f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2012-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -63,6 +63,11 @@ const uint64_t FingerprintTable<BITS>::poly[1 + (BITS - 1) / 64] = {};
 template <int BITS>
 const uint64_t FingerprintTable<BITS>::table[8][256][1 + (BITS - 1) / 64] = {};
 
+#ifndef _MSC_VER
+// MSVC 2015 can't handle these extern specialization declarations,
+// but they aren't needed for things to work right, so we just don't
+// declare them in the header for MSVC.
+
 #define FOLLY_DECLARE_FINGERPRINT_TABLES(BITS)                      \
   template <>                                                       \
   const uint64_t FingerprintTable<BITS>::poly[1 + (BITS - 1) / 64]; \
@@ -74,6 +79,7 @@ FOLLY_DECLARE_FINGERPRINT_TABLES(96);
 FOLLY_DECLARE_FINGERPRINT_TABLES(128);
 
 #undef FOLLY_DECLARE_FINGERPRINT_TABLES
+#endif
 
 } // namespace detail
 
@@ -93,8 +99,9 @@ class Fingerprint {
   Fingerprint() {
     // Use a non-zero starting value. We'll use (1 << (BITS-1))
     fp_[0] = 1ULL << 63;
-    for (int i = 1; i < size(); i++)
+    for (int i = 1; i < size(); i++) {
       fp_[i] = 0;
+    }
   }
 
   Fingerprint& update8(uint8_t v) {
@@ -278,4 +285,4 @@ inline uint64_t Fingerprint<128>::shlor64(uint64_t v) {
   return out;
 }
 
-}  // namespace folly
+} // namespace folly