10b57cec5SDimitry Andric //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // Defines the platforms which UBSan is supported at. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric #ifndef UBSAN_PLATFORM_H 130b57cec5SDimitry Andric #define UBSAN_PLATFORM_H 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric // Other platforms should be easy to add, and probably work as-is. 160b57cec5SDimitry Andric #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ 17*fe6060f1SDimitry Andric defined(__NetBSD__) || defined(__DragonFly__) || \ 18*fe6060f1SDimitry Andric (defined(__sun__) && defined(__svr4__)) || defined(_WIN32) || \ 19*fe6060f1SDimitry Andric defined(__Fuchsia__) 200b57cec5SDimitry Andric #define CAN_SANITIZE_UB 1 210b57cec5SDimitry Andric #else 220b57cec5SDimitry Andric # define CAN_SANITIZE_UB 0 230b57cec5SDimitry Andric #endif 240b57cec5SDimitry Andric 250b57cec5SDimitry Andric #endif 26