#pragma once
#include <cstddef>
#include <folly/CPortability.h>
#include <folly/portability/Config.h>
#if defined(_MSC_VER)
#define FOLLY_CPLUSPLUS …
#else
#define FOLLY_CPLUSPLUS …
#endif
#if !defined(_MSC_VER) && __has_include(<version>)
#include <version>
#endif
static_assert …;
#if defined(__GNUC__) && !defined(__clang__)
static_assert(__GNUC__ >= 10, "__GNUC__ >= 10");
#endif
#if defined(_MSC_VER)
static_assert(_MSC_VER >= 1920);
#endif
#if defined(_MSC_VER) || defined(_CPPLIB_VER)
static_assert(FOLLY_CPLUSPLUS >= 201703L, "__cplusplus >= 201703L");
#endif
namespace folly {
#if defined(FOLLY_HAVE_UNALIGNED_ACCESS) && FOLLY_HAVE_UNALIGNED_ACCESS
constexpr bool kHasUnalignedAccess = …;
#else
constexpr bool kHasUnalignedAccess = false;
#endif
}
#ifdef _MSC_VER
#ifdef _USE_ATTRIBUTES_FOR_SAL
#undef _USE_ATTRIBUTES_FOR_SAL
#endif
#define _USE_ATTRIBUTES_FOR_SAL …
#include <sal.h>
#define FOLLY_PRINTF_FORMAT …
#define FOLLY_PRINTF_FORMAT_ATTR …
#else
#define FOLLY_PRINTF_FORMAT …
#define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param) …
#endif
#if defined(__has_cpp_attribute)
#if __has_cpp_attribute(nodiscard)
#if defined(__clang__) || defined(__GNUC__)
#if __clang_major__ >= 10 || __GNUC__ >= 10
#define FOLLY_NODISCARD …
#endif
#endif
#endif
#endif
#ifndef FOLLY_NODISCARD
#define FOLLY_NODISCARD
#endif
#define FOLLY_DEPRECATED(...) …
#ifdef _MSC_VER
#define FOLLY_TARGET_ATTRIBUTE …
#else
#define FOLLY_TARGET_ATTRIBUTE(target) …
#endif
#if defined(__x86_64__) || defined(_M_X64)
#define FOLLY_X64 …
#else
#define FOLLY_X64 …
#endif
#if defined(__arm__)
#define FOLLY_ARM …
#else
#define FOLLY_ARM …
#endif
#if defined(__aarch64__)
#define FOLLY_AARCH64 …
#else
#define FOLLY_AARCH64 …
#endif
#if defined(__powerpc64__)
#define FOLLY_PPC64 …
#else
#define FOLLY_PPC64 …
#endif
#if defined(__s390x__)
#define FOLLY_S390X …
#else
#define FOLLY_S390X …
#endif
#if defined(__riscv)
#define FOLLY_RISCV64 …
#else
#define FOLLY_RISCV64 …
#endif
namespace folly {
constexpr bool kIsArchArm = …;
constexpr bool kIsArchAmd64 = …;
constexpr bool kIsArchAArch64 = …;
constexpr bool kIsArchPPC64 = …;
constexpr bool kIsArchS390X = …;
constexpr bool kIsArchRISCV64 = …;
}
namespace folly {
#if FOLLY_LIBRARY_SANITIZE_ADDRESS
constexpr bool kIsLibrarySanitizeAddress = true;
#else
constexpr bool kIsLibrarySanitizeAddress = …;
#endif
#ifdef FOLLY_SANITIZE_ADDRESS
constexpr bool kIsSanitizeAddress = true;
#else
constexpr bool kIsSanitizeAddress = …;
#endif
#ifdef FOLLY_SANITIZE_THREAD
constexpr bool kIsSanitizeThread = true;
#else
constexpr bool kIsSanitizeThread = …;
#endif
#ifdef FOLLY_SANITIZE_DATAFLOW
constexpr bool kIsSanitizeDataflow = true;
#else
constexpr bool kIsSanitizeDataflow = …;
#endif
#ifdef FOLLY_SANITIZE
constexpr bool kIsSanitize = true;
#else
constexpr bool kIsSanitize = …;
#endif
#if defined(__OPTIMIZE__)
constexpr bool kIsOptimize = true;
#else
constexpr bool kIsOptimize = …;
#endif
#if defined(__OPTIMIZE_SIZE__)
constexpr bool kIsOptimizeSize = true;
#else
constexpr bool kIsOptimizeSize = …;
#endif
}
#ifdef _MSC_VER
#define FOLLY_PACK_ATTR …
#define FOLLY_PACK_PUSH …
#define FOLLY_PACK_POP …
#elif defined(__GNUC__)
#define FOLLY_PACK_ATTR …
#define FOLLY_PACK_PUSH …
#define FOLLY_PACK_POP …
#else
#define FOLLY_PACK_ATTR …
#define FOLLY_PACK_PUSH …
#define FOLLY_PACK_POP …
#endif
#if defined(_LIBCPP_VERSION)
#define FOLLY_NAMESPACE_STD_BEGIN …
#define FOLLY_NAMESPACE_STD_END …
#else
#define FOLLY_NAMESPACE_STD_BEGIN …
#define FOLLY_NAMESPACE_STD_END …
#endif
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN …
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_END …
#else
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_END
#endif
#ifdef _MSC_VER
#ifndef __clang__
#if !defined(_M_ARM) && !defined(_M_ARM64)
#define __SSE4_2__ …
#endif
#define __extension__
#define __PRETTY_FUNCTION__ __FUNCSIG__
#endif
#endif
#if (defined(__cpp_exceptions) && __cpp_exceptions >= 199711) || \
FOLLY_HAS_FEATURE(cxx_exceptions)
#define FOLLY_HAS_EXCEPTIONS …
#elif __GNUC__
#if defined(__EXCEPTIONS) && __EXCEPTIONS
#define FOLLY_HAS_EXCEPTIONS …
#else
#define FOLLY_HAS_EXCEPTIONS …
#endif
#elif FOLLY_MICROSOFT_ABI_VER
#if _CPPUNWIND
#define FOLLY_HAS_EXCEPTIONS …
#else
#define FOLLY_HAS_EXCEPTIONS …
#endif
#else
#define FOLLY_HAS_EXCEPTIONS …
#endif
namespace folly {
#ifdef NDEBUG
constexpr auto kIsDebug = false;
#else
constexpr auto kIsDebug = …;
#endif
}
namespace folly {
#if FOLLY_HAS_EXCEPTIONS
constexpr auto kHasExceptions = …;
#else
constexpr auto kHasExceptions = false;
#endif
}
namespace folly {
#ifdef _MSC_VER
#ifdef FOLLY_ENDIAN_BE
constexpr auto kIsLittleEndian = false;
#else
constexpr auto kIsLittleEndian = true;
#endif
#else
constexpr auto kIsLittleEndian = …;
#endif
constexpr auto kIsBigEndian = …;
}
namespace folly {
#if FOLLY_HAVE_WEAK_SYMBOLS
constexpr auto kHasWeakSymbols = true;
#else
constexpr auto kHasWeakSymbols = …;
#endif
}
#ifndef FOLLY_SSE
#if defined(__SSE4_2__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#elif defined(__SSE4_1__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#elif defined(__SSE4__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#elif defined(__SSE3__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#elif defined(__SSE2__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#elif defined(__SSE__)
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#else
#define FOLLY_SSE …
#define FOLLY_SSE_MINOR …
#endif
#endif
#ifndef FOLLY_SSSE
#if defined(__SSSE3__)
#define FOLLY_SSSE …
#else
#define FOLLY_SSSE …
#endif
#endif
#define FOLLY_SSE_PREREQ(major, minor) …
#ifndef FOLLY_NEON
#if (defined(__ARM_NEON) || defined(__ARM_NEON__)) && !defined(__CUDACC__)
#define FOLLY_NEON …
#else
#define FOLLY_NEON …
#endif
#endif
#ifndef FOLLY_ARM_FEATURE_CRC32
#ifdef __ARM_FEATURE_CRC32
#define FOLLY_ARM_FEATURE_CRC32 …
#else
#define FOLLY_ARM_FEATURE_CRC32 …
#endif
#endif
#if defined(__GXX_RTTI) || defined(__cpp_rtti) || \
(defined(_MSC_VER) && defined(_CPPRTTI))
#define FOLLY_HAS_RTTI …
#else
#define FOLLY_HAS_RTTI …
#endif
namespace folly {
constexpr bool const kHasRtti = …;
}
#if defined(__APPLE__) || defined(_MSC_VER)
#define FOLLY_STATIC_CTOR_PRIORITY_MAX
#else
#define FOLLY_STATIC_CTOR_PRIORITY_MAX …
#endif
#if defined(__APPLE__) && TARGET_OS_IOS
#define FOLLY_APPLE_IOS …
#else
#define FOLLY_APPLE_IOS …
#endif
#if defined(__APPLE__) && TARGET_OS_OSX
#define FOLLY_APPLE_MACOS …
#else
#define FOLLY_APPLE_MACOS …
#endif
#if defined(__APPLE__) && TARGET_OS_TV
#define FOLLY_APPLE_TVOS …
#else
#define FOLLY_APPLE_TVOS …
#endif
#if defined(__APPLE__) && TARGET_OS_WATCH
#define FOLLY_APPLE_WATCHOS …
#else
#define FOLLY_APPLE_WATCHOS …
#endif
namespace folly {
#ifdef __OBJC__
constexpr auto kIsObjC = true;
#else
constexpr auto kIsObjC = …;
#endif
#if FOLLY_MOBILE
constexpr auto kIsMobile = true;
#else
constexpr auto kIsMobile = …;
#endif
#if defined(__linux__) && !FOLLY_MOBILE
constexpr auto kIsLinux = true;
#else
constexpr auto kIsLinux = …;
#endif
#if defined(_WIN32)
constexpr auto kIsWindows = true;
#else
constexpr auto kIsWindows = …;
#endif
#if defined(__APPLE__)
constexpr auto kIsApple = …;
#else
constexpr auto kIsApple = false;
#endif
constexpr bool kIsAppleIOS = …;
constexpr bool kIsAppleMacOS = …;
constexpr bool kIsAppleTVOS = …;
constexpr bool kIsAppleWatchOS = …;
#if defined(__GLIBCXX__)
constexpr auto kIsGlibcxx = true;
#else
constexpr auto kIsGlibcxx = …;
#endif
#if defined(__GLIBCXX__) && _GLIBCXX_RELEASE
constexpr auto kGlibcxxVer = _GLIBCXX_RELEASE;
#else
constexpr auto kGlibcxxVer = …;
#endif
#if defined(__GLIBCXX__) && defined(_GLIBCXX_ASSERTIONS)
constexpr auto kGlibcxxAssertions = true;
#else
constexpr auto kGlibcxxAssertions = …;
#endif
#ifdef _LIBCPP_VERSION
constexpr auto kIsLibcpp = …;
#else
constexpr auto kIsLibcpp = false;
#endif
#if defined(__GLIBCXX__)
constexpr auto kIsLibstdcpp = true;
#else
constexpr auto kIsLibstdcpp = …;
#endif
#ifdef _MSC_VER
constexpr auto kMscVer = _MSC_VER;
#else
constexpr auto kMscVer = …;
#endif
#if defined(__GNUC__) && __GNUC__
constexpr auto kGnuc = …;
#else
constexpr auto kGnuc = 0;
#endif
#if __clang__
constexpr auto kIsClang = …;
constexpr auto kClangVerMajor = …;
#else
constexpr auto kIsClang = false;
constexpr auto kClangVerMajor = 0;
#endif
#ifdef FOLLY_MICROSOFT_ABI_VER
constexpr auto kMicrosoftAbiVer = FOLLY_MICROSOFT_ABI_VER;
#else
constexpr auto kMicrosoftAbiVer = …;
#endif
#ifdef _CPPLIB_VER
constexpr auto kCpplibVer = _CPPLIB_VER;
#else
constexpr auto kCpplibVer = …;
#endif
}
#ifdef _MSC_VER
#define FOLLY_STORAGE_CONSTEXPR
#else
#define FOLLY_STORAGE_CONSTEXPR …
#endif
#if FOLLY_CPLUSPLUS >= 202002L
#define FOLLY_CXX20_CONSTEXPR …
#else
#define FOLLY_CXX20_CONSTEXPR
#endif
#if FOLLY_CPLUSPLUS >= 202302L
#define FOLLY_CXX23_CONSTEXPR …
#else
#define FOLLY_CXX23_CONSTEXPR
#endif
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
#define FOLLY_CONSTINIT …
#else
#define FOLLY_CONSTINIT
#endif
#if defined(FOLLY_CFG_NO_COROUTINES)
#define FOLLY_HAS_COROUTINES …
#else
#if defined(__NVCC__)
#define FOLLY_HAS_COROUTINES …
#elif defined(_WIN32) && defined(__clang__) && !defined(LLVM_COROUTINES)
#define FOLLY_HAS_COROUTINES …
#elif defined(_MSC_VER) && _MSC_VER && defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
#define FOLLY_HAS_COROUTINES …
#elif ( \
(defined(__cpp_coroutines) && __cpp_coroutines >= 201703L) || \
(defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L)) && \
(__has_include(<coroutine>) || __has_include(<experimental/coroutine>))
#define FOLLY_HAS_COROUTINES …
#define FOLLY_CORO_AWAIT_SUSPEND_NONTRIVIAL_ATTRIBUTES …
#else
#define FOLLY_HAS_COROUTINES …
#endif
#endif
#if FOLLY_CPLUSPLUS >= 202002L
#define FOLLY_CONSTEVAL …
#else
#define FOLLY_CONSTEVAL …
#endif