Summary:
MSVC doesn't allow uninitialized non-`extern` `const` declarations, but we can't mark them `extern` because they are part of a template specialization. We also can't initialize them, because they'd conflict with the definition specializations in the generated tables.
As the forward-declarations aren't required for it to work under MSVC, as the specializations are found appropriately, just don't declare the specializations under MSVC.
Reviewed By: yfeldblum
Differential Revision:
D4098282
fbshipit-source-id:
84b73d63bbe6cf9c54b7fe7a3bfc2488699df7c2
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]; \
FOLLY_DECLARE_FINGERPRINT_TABLES(128);
#undef FOLLY_DECLARE_FINGERPRINT_TABLES
+#endif
} // namespace detail