xref: /netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/ubsan/ubsan_platform.h (revision c0a68be459da21030695f60d10265c2fc49758f8)
1 //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Defines the platforms which UBSan is supported at.
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef UBSAN_PLATFORM_H
12 #define UBSAN_PLATFORM_H
13 
14 #ifndef CAN_SANITIZE_UB
15 // Other platforms should be easy to add, and probably work as-is.
16 #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ||        \
17     defined(__NetBSD__) || defined(__OpenBSD__) || \
18     (defined(__sun__) && defined(__svr4__)) || \
19     defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__)
20 # define CAN_SANITIZE_UB 1
21 #else
22 # define CAN_SANITIZE_UB 0
23 #endif
24 #endif //CAN_SANITIZE_UB
25 
26 #endif
27