namespace folly {
namespace detail {
+
template <int BITS>
struct FingerprintTable {
- static const uint64_t poly[1 + (BITS-1)/64];
- static const uint64_t table[8][256][1 + (BITS-1)/64];
+ static const uint64_t poly[1 + (BITS - 1) / 64];
+ static const uint64_t table[8][256][1 + (BITS - 1) / 64];
};
-} // namespace detail
+
+template <int BITS>
+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] = {};
+
+#define FOLLY_DECLARE_FINGERPRINT_TABLES(BITS) \
+ template <> \
+ const uint64_t FingerprintTable<BITS>::poly[1 + (BITS - 1) / 64]; \
+ template <> \
+ const uint64_t FingerprintTable<BITS>::table[8][256][1 + (BITS - 1) / 64]
+
+FOLLY_DECLARE_FINGERPRINT_TABLES(64);
+FOLLY_DECLARE_FINGERPRINT_TABLES(96);
+FOLLY_DECLARE_FINGERPRINT_TABLES(128);
+
+#undef FOLLY_DECLARE_FINGERPRINT_TABLES
+
+} // namespace detail
/**
* Compute the Rabin fingerprint.