13cab2bb3Spatrick //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===// 23cab2bb3Spatrick // 33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information. 53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 63cab2bb3Spatrick // 73cab2bb3Spatrick //===----------------------------------------------------------------------===// 83cab2bb3Spatrick // 93cab2bb3Spatrick // Defines the platforms which UBSan is supported at. 103cab2bb3Spatrick // 113cab2bb3Spatrick //===----------------------------------------------------------------------===// 123cab2bb3Spatrick #ifndef UBSAN_PLATFORM_H 133cab2bb3Spatrick #define UBSAN_PLATFORM_H 143cab2bb3Spatrick 153cab2bb3Spatrick // Other platforms should be easy to add, and probably work as-is. 163cab2bb3Spatrick #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ 17*5e1c9963Sgnezdo defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || \ 18d89ec533Spatrick (defined(__sun__) && defined(__svr4__)) || defined(_WIN32) || \ 19d89ec533Spatrick defined(__Fuchsia__) 203cab2bb3Spatrick #define CAN_SANITIZE_UB 1 213cab2bb3Spatrick #else 223cab2bb3Spatrick # define CAN_SANITIZE_UB 0 233cab2bb3Spatrick #endif 243cab2bb3Spatrick 253cab2bb3Spatrick #endif 26