26 #if FOLLY_HAVE_UNALIGNED_ACCESS 29 constexpr
bool kHasUnalignedAccess =
false;
38 #ifdef _USE_ATTRIBUTES_FOR_SAL 39 #undef _USE_ATTRIBUTES_FOR_SAL 42 #define _USE_ATTRIBUTES_FOR_SAL 1 44 #define FOLLY_PRINTF_FORMAT _Printf_format_string_ 45 #define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param) 47 #define FOLLY_PRINTF_FORMAT 48 #define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param) \ 49 __attribute__((__format__(__printf__, format_param, dots_param))) 53 #if defined(__has_cpp_attribute) 54 #if __has_cpp_attribute(nodiscard) 55 #define FOLLY_NODISCARD [[nodiscard]] 58 #if !defined FOLLY_NODISCARD 59 #if defined(_MSC_VER) && (_MSC_VER >= 1700) 60 #define FOLLY_NODISCARD _Check_return_ 61 #elif defined(__clang__) || defined(__GNUC__) 62 #define FOLLY_NODISCARD __attribute__((__warn_unused_result__)) 64 #define FOLLY_NODISCARD 70 #define FOLLY_TARGET_ATTRIBUTE(target) 72 #define FOLLY_TARGET_ATTRIBUTE(target) __attribute__((__target__(target))) 76 #if defined(__x86_64__) || defined(_M_X64) 88 #if defined(__aarch64__) 89 #define FOLLY_AARCH64 1 91 #define FOLLY_AARCH64 0 94 #if defined(__powerpc64__) 115 #if FOLLY_ASAN_ENABLED 118 constexpr
bool kIsSanitizeAddress =
false;
121 #if FOLLY_SANITIZE_THREAD 124 constexpr
bool kIsSanitizeThread =
false;
130 constexpr
bool kIsSanitize =
false;
136 #define FOLLY_PACK_ATTR 137 #define FOLLY_PACK_PUSH __pragma(pack(push, 1)) 138 #define FOLLY_PACK_POP __pragma(pack(pop)) 139 #elif defined(__clang__) || defined(__GNUC__) 140 #define FOLLY_PACK_ATTR __attribute__((__packed__)) 141 #define FOLLY_PACK_PUSH 142 #define FOLLY_PACK_POP 144 #define FOLLY_PACK_ATTR 145 #define FOLLY_PACK_PUSH 146 #define FOLLY_PACK_POP 150 #if defined(_MSC_VER) 151 #define FOLLY_PUSH_WARNING __pragma(warning(push)) 152 #define FOLLY_POP_WARNING __pragma(warning(pop)) 154 #define FOLLY_GNU_DISABLE_WARNING(warningName) 155 #define FOLLY_GCC_DISABLE_WARNING(warningName) 156 #define FOLLY_CLANG_DISABLE_WARNING(warningName) 157 #define FOLLY_MSVC_DISABLE_WARNING(warningNumber) \ 158 __pragma(warning(disable : warningNumber)) 159 #elif defined(__GNUC__) 161 #define FOLLY_PUSH_WARNING _Pragma("GCC diagnostic push") 162 #define FOLLY_POP_WARNING _Pragma("GCC diagnostic pop") 163 #define FOLLY_GNU_DISABLE_WARNING_INTERNAL2(warningName) #warningName 164 #define FOLLY_GNU_DISABLE_WARNING(warningName) \ 166 FOLLY_GNU_DISABLE_WARNING_INTERNAL2(GCC diagnostic ignored warningName)) 168 #define FOLLY_CLANG_DISABLE_WARNING(warningName) \ 169 FOLLY_GNU_DISABLE_WARNING(warningName) 170 #define FOLLY_GCC_DISABLE_WARNING(warningName) 172 #define FOLLY_CLANG_DISABLE_WARNING(warningName) 173 #define FOLLY_GCC_DISABLE_WARNING(warningName) \ 174 FOLLY_GNU_DISABLE_WARNING(warningName) 176 #define FOLLY_MSVC_DISABLE_WARNING(warningNumber) 178 #define FOLLY_PUSH_WARNING 179 #define FOLLY_POP_WARNING 180 #define FOLLY_GNU_DISABLE_WARNING(warningName) 181 #define FOLLY_GCC_DISABLE_WARNING(warningName) 182 #define FOLLY_CLANG_DISABLE_WARNING(warningName) 183 #define FOLLY_MSVC_DISABLE_WARNING(warningNumber) 186 #ifdef FOLLY_HAVE_SHADOW_LOCAL_WARNINGS 187 #define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \ 188 FOLLY_GNU_DISABLE_WARNING("-Wshadow-compatible-local") \ 189 FOLLY_GNU_DISABLE_WARNING("-Wshadow-local") \ 190 FOLLY_GNU_DISABLE_WARNING("-Wshadow") 192 #define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS 196 #if __GNUC__ == 4 && !__clang__ 206 #if defined(_MSC_VER) 207 #define FOLLY_TLS __declspec(thread) 208 #elif defined(__GNUC__) || defined(__clang__) 209 #define FOLLY_TLS __thread 211 #error cannot define platform specific thread local storage 223 #define FOLLY_NAMESPACE_STD_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD 224 #define FOLLY_NAMESPACE_STD_END _LIBCPP_END_NAMESPACE_STD 226 #define FOLLY_NAMESPACE_STD_BEGIN namespace std { 227 #define FOLLY_NAMESPACE_STD_END } 232 #if _GLIBCXX_USE_CXX11_ABI 233 #define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN \ 234 inline _GLIBCXX_BEGIN_NAMESPACE_CXX11 235 #define FOLLY_GLIBCXX_NAMESPACE_CXX11_END _GLIBCXX_END_NAMESPACE_CXX11 237 #define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN 238 #define FOLLY_GLIBCXX_NAMESPACE_CXX11_END 248 #define __PRETTY_FUNCTION__ __FUNCSIG__ 251 #define __extension__ 264 constexpr
auto kIsDebug =
true;
272 #ifdef FOLLY_ENDIAN_BE 275 constexpr
auto kIsLittleEndian =
true;
278 constexpr
auto kIsLittleEndian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
284 #if defined(__SSE4_2__) 286 #define FOLLY_SSE_MINOR 2 287 #elif defined(__SSE4_1__) 289 #define FOLLY_SSE_MINOR 1 290 #elif defined(__SSE4__) 292 #define FOLLY_SSE_MINOR 0 293 #elif defined(__SSE3__) 295 #define FOLLY_SSE_MINOR 0 296 #elif defined(__SSE2__) 298 #define FOLLY_SSE_MINOR 0 299 #elif defined(__SSE__) 301 #define FOLLY_SSE_MINOR 0 304 #define FOLLY_SSE_MINOR 0 308 #define FOLLY_SSE_PREREQ(major, minor) \ 309 (FOLLY_SSE > major || FOLLY_SSE == major && FOLLY_SSE_MINOR >= minor) 312 #if defined(__ARM_NEON) || defined(__ARM_NEON__) 317 #if FOLLY_UNUSUAL_GFLAGS_NAMESPACE 326 #include <TargetConditionals.h> 330 #if defined(__GXX_RTTI) || defined(__cpp_rtti) || \ 331 (defined(_MSC_VER) && defined(_CPPRTTI)) 332 #define FOLLY_HAS_RTTI 1 335 #if defined(__APPLE__) || defined(_MSC_VER) 336 #define FOLLY_STATIC_CTOR_PRIORITY_MAX 341 #define FOLLY_STATIC_CTOR_PRIORITY_MAX __attribute__((__init_priority__(102))) 349 constexpr
auto kIsObjC =
false;
355 constexpr
auto kIsMobile =
false;
358 #if defined(__linux__) && !FOLLY_MOBILE 361 constexpr
auto kIsLinux =
false;
367 constexpr
auto kIsWindows =
false;
373 constexpr
auto kIsGlibcxx =
false;
379 constexpr
auto kIsLibcpp =
false;
382 #if FOLLY_USE_LIBSTDCPP 385 constexpr
auto kIsLibstdcpp =
false;
389 constexpr
auto kMscVer = _MSC_VER;
391 constexpr
auto kMscVer = 0;
394 #if FOLLY_MICROSOFT_ABI_VER 397 constexpr
auto kMicrosoftAbiVer = 0;
405 constexpr
auto kCpplibVer = 0;
411 #ifndef FOLLY_USE_CPP14_CONSTEXPR 412 #if defined(__clang__) 413 #define FOLLY_USE_CPP14_CONSTEXPR __cplusplus >= 201300L 414 #elif defined(__GNUC__) 415 #define FOLLY_USE_CPP14_CONSTEXPR __cplusplus >= 201304L 417 #define FOLLY_USE_CPP14_CONSTEXPR 0 // MSVC? 421 #if FOLLY_USE_CPP14_CONSTEXPR 422 #define FOLLY_CPP14_CONSTEXPR constexpr 424 #define FOLLY_CPP14_CONSTEXPR inline 439 #define FOLLY_STORAGE_CONSTEXPR 440 #define FOLLY_STORAGE_CPP14_CONSTEXPR 443 #define FOLLY_STORAGE_CONSTEXPR 445 #define FOLLY_STORAGE_CONSTEXPR constexpr 447 #if FOLLY_USE_CPP14_CONSTEXPR 448 #define FOLLY_STORAGE_CPP14_CONSTEXPR constexpr 450 #define FOLLY_STORAGE_CPP14_CONSTEXPR 454 #if __cpp_coroutines >= 201703L && __has_include(<experimental/coroutine>) 455 #define FOLLY_HAS_COROUTINES 1 456 #elif _MSC_VER && _RESUMABLE_FUNCTIONS_SUPPORTED 457 #define FOLLY_HAS_COROUTINES 1 461 #if __cpp_noexcept_function_type >= 201510 || \ 462 (_MSC_FULL_VER >= 191225816 && _MSVC_LANG > 201402) 463 #define FOLLY_HAVE_NOEXCEPT_FUNCTION_TYPE 1 467 #if __cpp_exceptions >= 199711 || FOLLY_HAS_FEATURE(cxx_exceptions) 468 #define FOLLY_HAS_EXCEPTIONS 1 471 #define FOLLY_HAS_EXCEPTIONS 1 472 #else // __EXCEPTIONS 473 #define FOLLY_HAS_EXCEPTIONS 0 474 #endif // __EXCEPTIONS 475 #elif FOLLY_MICROSOFT_ABI_VER 477 #define FOLLY_HAS_EXCEPTIONS 1 479 #define FOLLY_HAS_EXCEPTIONS 0 482 #define FOLLY_HAS_EXCEPTIONS 1 // default assumption for unknown platforms 489 #if __has_include(<string_view>) && __cplusplus >= 201703L 490 #define FOLLY_HAS_STRING_VIEW 1 492 #define FOLLY_HAS_STRING_VIEW 0 494 #else // __has_include 495 #if _MSC_VER >= 1910 && (_MSVC_LANG > 201402 || __cplusplus > 201402) 496 #define FOLLY_HAS_STRING_VIEW 1 498 #define FOLLY_HAS_STRING_VIEW 0 500 #endif // __has_include constexpr bool kHasUnalignedAccess
constexpr bool kIsSanitizeThread
constexpr bool kIsSanitizeAddress
constexpr bool kIsArchPPC64
constexpr auto kIsLittleEndian
—— Concurrent Priority Queue Implementation ——
constexpr auto kMicrosoftAbiVer
#define FOLLY_GFLAGS_NAMESPACE
constexpr bool kIsSanitize
constexpr bool kIsArchAArch64
constexpr auto kIsLibstdcpp
#define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS
constexpr auto kIsGlibcxx
constexpr auto kCpplibVer
constexpr bool kIsArchArm
constexpr auto kIsWindows
constexpr bool kIsArchAmd64
constexpr auto kIsBigEndian