Use FOLLY_DEPRECATED rather than directly using GCC specific attributes.
[folly.git] / folly / Portability.h
index bdac6cc33fe714e24a75baed89d2585940923bad..63318a2ce3a2ae14783dc5f265071760b1756bd5 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef FOLLY_PORTABILITY_H_
 #define FOLLY_PORTABILITY_H_
 
+// @nocommit invalidate ccache 20151125 (see #8764509)
+
 #include <string.h>
 
 #include <cstddef>
  #endif
 #endif
 
+#ifndef FOLLY_HAVE_UNALIGNED_READS
+#define FOLLY_HAVE_UNALIGNED_READS 0
+#endif
+
 // A change in folly/MemoryMapping.cpp uses MAP_ANONYMOUS, which is named
 // MAP_ANON on OSX/BSD.
 #if defined(__APPLE__) || defined(__FreeBSD__)
@@ -397,5 +403,14 @@ constexpr size_t constexpr_strlen(const char* s) {
 #endif
 }
 
+#if defined(__APPLE__) || defined(_MSC_VER)
+#define MAX_STATIC_CONSTRUCTOR_PRIORITY
+#else
+// 101 is the highest priority allowed by the init_priority attribute.
+// This priority is already used by JEMalloc and other memory allocators so
+// we will take the next one.
+#define MAX_STATIC_CONSTRUCTOR_PRIORITY __attribute__ ((__init_priority__(102)))
+#endif
+
 } // namespace folly
 #endif // FOLLY_PORTABILITY_H_