#ifndef SANITIZER_PLATFORM_H
#define SANITIZER_PLATFORM_H
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) && \
!(defined(__sun__) && defined(__svr4__))
# error "This operating system is not supported"
#endif
#if __has_include(<features.h>) && !defined(__ANDROID__)
# include <features.h>
#endif
#if defined(__linux__)
#define SANITIZER_LINUX …
#else
#define SANITIZER_LINUX …
#endif
#if defined(__GLIBC__)
#define SANITIZER_GLIBC …
#else
#define SANITIZER_GLIBC …
#endif
#if defined(__FreeBSD__)
#define SANITIZER_FREEBSD …
#else
#define SANITIZER_FREEBSD …
#endif
#if defined(__NetBSD__)
#define SANITIZER_NETBSD …
#else
#define SANITIZER_NETBSD …
#endif
#if defined(__sun__) && defined(__svr4__)
#define SANITIZER_SOLARIS …
#else
#define SANITIZER_SOLARIS …
#endif
#if defined(__APPLE__)
#define SANITIZER_APPLE …
# include <TargetConditionals.h>
# if TARGET_OS_OSX
#define SANITIZER_OSX …
# else
#define SANITIZER_OSX …
# endif
# if TARGET_OS_IPHONE
#define SANITIZER_IOS …
# else
#define SANITIZER_IOS …
# endif
# if TARGET_OS_WATCH
#define SANITIZER_WATCHOS …
# else
#define SANITIZER_WATCHOS …
# endif
# if TARGET_OS_TV
#define SANITIZER_TVOS …
# else
#define SANITIZER_TVOS …
# endif
# if TARGET_OS_SIMULATOR
#define SANITIZER_IOSSIM …
# else
#define SANITIZER_IOSSIM …
# endif
# if defined(TARGET_OS_DRIVERKIT) && TARGET_OS_DRIVERKIT
#define SANITIZER_DRIVERKIT …
# else
#define SANITIZER_DRIVERKIT …
# endif
#else
#define SANITIZER_APPLE …
#define SANITIZER_OSX …
#define SANITIZER_IOS …
#define SANITIZER_WATCHOS …
#define SANITIZER_TVOS …
#define SANITIZER_IOSSIM …
#define SANITIZER_DRIVERKIT …
#endif
#if defined(_WIN32)
#define SANITIZER_WINDOWS …
#else
#define SANITIZER_WINDOWS …
#endif
#if defined(_WIN64)
#define SANITIZER_WINDOWS64 …
#else
#define SANITIZER_WINDOWS64 …
#endif
#if defined(__ANDROID__)
#define SANITIZER_ANDROID …
#else
#define SANITIZER_ANDROID …
#endif
#if defined(__Fuchsia__)
#define SANITIZER_FUCHSIA …
#else
#define SANITIZER_FUCHSIA …
#endif
#if SANITIZER_LINUX && !SANITIZER_GLIBC && !SANITIZER_ANDROID
#define SANITIZER_MUSL …
#else
#define SANITIZER_MUSL …
#endif
#define SANITIZER_POSIX …
#if __LP64__ || defined(_WIN64)
#define SANITIZER_WORDSIZE …
#else
#define SANITIZER_WORDSIZE …
#endif
#if SANITIZER_WORDSIZE == 64
#define FIRST_32_SECOND_64(a, b) …
#else
#define FIRST_32_SECOND_64 …
#endif
#if defined(__x86_64__) && !defined(_LP64)
#define SANITIZER_X32 …
#else
#define SANITIZER_X32 …
#endif
#if defined(__x86_64__) || defined(_M_X64)
#define SANITIZER_X64 …
#else
#define SANITIZER_X64 …
#endif
#if defined(__i386__) || defined(_M_IX86)
#define SANITIZER_I386 …
#else
#define SANITIZER_I386 …
#endif
#if defined(__mips__)
#define SANITIZER_MIPS …
# if defined(__mips64) && _MIPS_SIM == _ABI64
#define SANITIZER_MIPS32 …
#define SANITIZER_MIPS64 …
# else
#define SANITIZER_MIPS32 …
#define SANITIZER_MIPS64 …
# endif
#else
#define SANITIZER_MIPS …
#define SANITIZER_MIPS32 …
#define SANITIZER_MIPS64 …
#endif
#if defined(__s390__)
#define SANITIZER_S390 …
# if defined(__s390x__)
#define SANITIZER_S390_31 …
#define SANITIZER_S390_64 …
# else
#define SANITIZER_S390_31 …
#define SANITIZER_S390_64 …
# endif
#else
#define SANITIZER_S390 …
#define SANITIZER_S390_31 …
#define SANITIZER_S390_64 …
#endif
#if defined(__sparc__)
#define SANITIZER_SPARC …
# if defined(__arch64__)
#define SANITIZER_SPARC32 …
#define SANITIZER_SPARC64 …
# else
#define SANITIZER_SPARC32 …
#define SANITIZER_SPARC64 …
# endif
#else
#define SANITIZER_SPARC …
#define SANITIZER_SPARC32 …
#define SANITIZER_SPARC64 …
#endif
#if defined(__powerpc__)
#define SANITIZER_PPC …
# if defined(__powerpc64__)
#define SANITIZER_PPC32 …
#define SANITIZER_PPC64 …
# if _CALL_ELF == 2
#define SANITIZER_PPC64V1 …
#define SANITIZER_PPC64V2 …
# else
#define SANITIZER_PPC64V1 …
#define SANITIZER_PPC64V2 …
# endif
# else
#define SANITIZER_PPC32 …
#define SANITIZER_PPC64 …
#define SANITIZER_PPC64V1 …
#define SANITIZER_PPC64V2 …
# endif
#else
#define SANITIZER_PPC …
#define SANITIZER_PPC32 …
#define SANITIZER_PPC64 …
#define SANITIZER_PPC64V1 …
#define SANITIZER_PPC64V2 …
#endif
#if defined(__arm__) || defined(_M_ARM)
#define SANITIZER_ARM …
#else
#define SANITIZER_ARM …
#endif
#if defined(__aarch64__) || defined(_M_ARM64)
#define SANITIZER_ARM64 …
#else
#define SANITIZER_ARM64 …
#endif
#if SANITIZER_WINDOWS64 && SANITIZER_ARM64
#define SANITIZER_WINDOWS_ARM64 …
#define SANITIZER_WINDOWS_x64 …
#elif SANITIZER_WINDOWS64 && !SANITIZER_ARM64
#define SANITIZER_WINDOWS_ARM64 …
#define SANITIZER_WINDOWS_x64 …
#else
#define SANITIZER_WINDOWS_ARM64 …
#define SANITIZER_WINDOWS_x64 …
#endif
#if SANITIZER_SOLARIS && SANITIZER_WORDSIZE == 32
#define SANITIZER_SOLARIS32 …
#else
#define SANITIZER_SOLARIS32 …
#endif
#if defined(__riscv) && (__riscv_xlen == 64)
#define SANITIZER_RISCV64 …
#else
#define SANITIZER_RISCV64 …
#endif
#if defined(__loongarch_lp64)
#define SANITIZER_LOONGARCH64 …
#else
#define SANITIZER_LOONGARCH64 …
#endif
#ifndef SANITIZER_CAN_USE_ALLOCATOR64
# if (SANITIZER_RISCV64 && !SANITIZER_FUCHSIA && !SANITIZER_LINUX) || \
SANITIZER_IOS || SANITIZER_DRIVERKIT
#define SANITIZER_CAN_USE_ALLOCATOR64 …
# elif defined(__mips64) || defined(__hexagon__)
#define SANITIZER_CAN_USE_ALLOCATOR64 …
# else
#define SANITIZER_CAN_USE_ALLOCATOR64 …
# endif
#endif
#if defined(__mips__)
# if SANITIZER_GO && defined(__mips64)
#define SANITIZER_MMAP_RANGE_SIZE …
# else
#define SANITIZER_MMAP_RANGE_SIZE …
# endif
#elif SANITIZER_RISCV64
# if SANITIZER_FUCHSIA
#define SANITIZER_MMAP_RANGE_SIZE …
# else
#define SANITIZER_MMAP_RANGE_SIZE …
# endif
#elif defined(__aarch64__)
# if SANITIZER_APPLE
# if SANITIZER_OSX || SANITIZER_IOSSIM
#define SANITIZER_MMAP_RANGE_SIZE …
# else
#define SANITIZER_MMAP_RANGE_SIZE …
# endif
# else
#define SANITIZER_MMAP_RANGE_SIZE …
# endif
#elif defined(__sparc__)
#define SANITIZER_MMAP_RANGE_SIZE …
#else
#define SANITIZER_MMAP_RANGE_SIZE …
#endif
#if defined(__sparc__) && SANITIZER_WORDSIZE == 64
#define SANITIZER_SIGN_EXTENDED_ADDRESSES …
#else
#define SANITIZER_SIGN_EXTENDED_ADDRESSES …
#endif
#if defined(__arm__) || SANITIZER_X32 || defined(__sparc__)
#define SANITIZER_USES_UID16_SYSCALLS …
#else
#define SANITIZER_USES_UID16_SYSCALLS …
#endif
#if defined(__mips__)
#define SANITIZER_POINTER_FORMAT_LENGTH …
#else
#define SANITIZER_POINTER_FORMAT_LENGTH …
#endif
#ifdef _MSC_VER
#define MSC_PREREQ …
#else
#define MSC_PREREQ(version) …
#endif
#if SANITIZER_APPLE && defined(__x86_64__)
#define SANITIZER_NON_UNIQUE_TYPEINFO …
#else
#define SANITIZER_NON_UNIQUE_TYPEINFO …
#endif
#if SANITIZER_LINUX && (SANITIZER_S390 || SANITIZER_PPC32 || SANITIZER_PPC64V1)
#define SANITIZER_NLDBL_VERSION …
#endif
#if SANITIZER_GO == 0
#define SANITIZER_GO …
#endif
#if SANITIZER_PPC || defined(__thumb__)
#define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT …
#else
#define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT …
#endif
#if SANITIZER_FREEBSD || SANITIZER_APPLE || SANITIZER_NETBSD || SANITIZER_SOLARIS
#define SANITIZER_MADVISE_DONTNEED …
#else
#define SANITIZER_MADVISE_DONTNEED …
#endif
#if defined(__powerpc__) || defined(__powerpc64__)
#define SANITIZER_CACHE_LINE_SIZE …
#else
#define SANITIZER_CACHE_LINE_SIZE …
#endif
#if SANITIZER_FUCHSIA
#define SANITIZER_SYMBOLIZER_MARKUP …
#else
#define SANITIZER_SYMBOLIZER_MARKUP …
#endif
#if SANITIZER_APPLE
#define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN …
#else
#define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN …
#endif
#ifndef __has_feature
#define SANITIZER_SUPPORTS_THREADLOCAL …
#else
# if __has_feature(tls)
#define SANITIZER_SUPPORTS_THREADLOCAL …
# else
#define SANITIZER_SUPPORTS_THREADLOCAL …
# endif
#endif
#if defined(__thumb__) && defined(__linux__)
#define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL …
#else
#define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL …
#endif
#endif