+#endif
+
+#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
+
+#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
+
+// MacOS doesn't have malloc_usable_size()
+#if defined(__APPLE__) && !defined(FOLLY_HAVE_MALLOC_USABLE_SIZE)
+inline size_t malloc_usable_size(void* ptr) {
+ return malloc_size(ptr);
+}
+#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
+
+#ifdef _MSC_VER
+# include <intrin.h>
+#endif
+
+namespace folly {
+
+inline void asm_volatile_memory() {
+#if defined(__clang__) || defined(__GNUC__)
+ asm volatile("" : : : "memory");
+#elif defined(_MSC_VER)
+ ::_ReadWriteBarrier();
+#endif
+}
+
+inline void asm_volatile_pause() {
+#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+ ::_mm_pause();
+#elif defined(__i386__) || FOLLY_X64
+ asm volatile ("pause");
+#elif FOLLY_A64
+ asm volatile ("wfe");
+#endif
+}
+inline void asm_pause() {
+#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+ ::_mm_pause();
+#elif defined(__i386__) || FOLLY_X64
+ asm ("pause");
+#elif FOLLY_A64
+ asm ("wfe");
+#endif
+}
+
+}
+