+// If the new c++ ABI is used, __cxx11 inline namespace needs to be added to
+// some types, e.g. std::list.
+#if _GLIBCXX_USE_CXX11_ABI
+#define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN \
+ inline _GLIBCXX_BEGIN_NAMESPACE_CXX11
+# define FOLLY_GLIBCXX_NAMESPACE_CXX11_END _GLIBCXX_END_NAMESPACE_CXX11
+#else
+# define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN
+# define FOLLY_GLIBCXX_NAMESPACE_CXX11_END
+#endif
+
+// MSVC specific defines
+// mainly for posix compat
+#ifdef _MSC_VER
+#include <folly/portability/SysTypes.h>
+
+// compiler specific to compiler specific
+// nolint
+# define __PRETTY_FUNCTION__ __FUNCSIG__
+
+// Hide a GCC specific thing that breaks MSVC if left alone.
+# define __extension__
+
+// We have compiler support for the newest of the new, but
+// MSVC doesn't tell us that.
+#define __SSE4_2__ 1
+
+#endif
+
+// Debug
+namespace folly {
+#ifdef NDEBUG
+constexpr auto kIsDebug = false;
+#else
+constexpr auto kIsDebug = true;
+#endif
+}
+
+// Endianness
+namespace folly {
+#ifdef _MSC_VER
+// It's MSVC, so we just have to guess ... and allow an override
+#ifdef FOLLY_ENDIAN_BE
+constexpr auto kIsLittleEndian = false;
+#else
+constexpr auto kIsLittleEndian = true;
+#endif
+#else
+constexpr auto kIsLittleEndian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
+#endif
+constexpr auto kIsBigEndian = !kIsLittleEndian;
+}
+
+#ifndef FOLLY_SSE
+# if defined(__SSE4_2__)
+# define FOLLY_SSE 4
+# define FOLLY_SSE_MINOR 2
+# elif defined(__SSE4_1__)
+# define FOLLY_SSE 4
+# define FOLLY_SSE_MINOR 1
+# elif defined(__SSE4__)
+# define FOLLY_SSE 4
+# define FOLLY_SSE_MINOR 0
+# elif defined(__SSE3__)
+# define FOLLY_SSE 3
+# define FOLLY_SSE_MINOR 0
+# elif defined(__SSE2__)
+# define FOLLY_SSE 2
+# define FOLLY_SSE_MINOR 0
+# elif defined(__SSE__)
+# define FOLLY_SSE 1
+# define FOLLY_SSE_MINOR 0
+# else
+# define FOLLY_SSE 0
+# define FOLLY_SSE_MINOR 0
+# endif
+#endif
+
+#define FOLLY_SSE_PREREQ(major, minor) \
+ (FOLLY_SSE > major || FOLLY_SSE == major && FOLLY_SSE_MINOR >= minor)
+
+#if FOLLY_UNUSUAL_GFLAGS_NAMESPACE
+namespace FOLLY_GFLAGS_NAMESPACE { }
+namespace gflags {
+using namespace FOLLY_GFLAGS_NAMESPACE;
+} // namespace gflags
+#endif
+
+// for TARGET_OS_IPHONE
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#endif
+
+// RTTI may not be enabled for this compilation unit.
+#if defined(__GXX_RTTI) || defined(__cpp_rtti) || \
+ (defined(_MSC_VER) && defined(_CPPRTTI))
+# define FOLLY_HAS_RTTI 1
+#endif
+
+#if defined(__APPLE__) || defined(_MSC_VER)
+#define FOLLY_STATIC_CTOR_PRIORITY_MAX