111
|
1 //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
|
|
2 //
|
145
|
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4 // See https://llvm.org/LICENSE.txt for license information.
|
|
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
111
|
6 //
|
|
7 //===----------------------------------------------------------------------===//
|
|
8 //
|
|
9 // Defines the platforms which UBSan is supported at.
|
|
10 //
|
|
11 //===----------------------------------------------------------------------===//
|
|
12 #ifndef UBSAN_PLATFORM_H
|
|
13 #define UBSAN_PLATFORM_H
|
|
14
|
|
15 #ifndef CAN_SANITIZE_UB
|
|
16 // Other platforms should be easy to add, and probably work as-is.
|
145
|
17 #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
|
|
18 defined(__NetBSD__) || defined(__OpenBSD__) || \
|
|
19 (defined(__sun__) && defined(__svr4__)) || \
|
|
20 defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__)
|
111
|
21 # define CAN_SANITIZE_UB 1
|
|
22 #else
|
|
23 # define CAN_SANITIZE_UB 0
|
|
24 #endif
|
|
25 #endif //CAN_SANITIZE_UB
|
|
26
|
|
27 #endif
|