* include/bits/stl_deque.h (_Deque_impl): Move comment.
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_platform.h
blob7693fe7ff17cb9a3174d1e9342fab0bb620ed924
1 //===-- sanitizer_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 // Common platform macros.
9 //===----------------------------------------------------------------------===//
11 #ifndef SANITIZER_PLATFORM_H
12 #define SANITIZER_PLATFORM_H
14 #if !defined(__linux__) && !defined(__APPLE__) && !defined(_WIN32)
15 # error "This operating system is not supported"
16 #endif
18 #if defined(__linux__)
19 # define SANITIZER_LINUX 1
20 #else
21 # define SANITIZER_LINUX 0
22 #endif
24 #if defined(__APPLE__)
25 # define SANITIZER_MAC 1
26 # include <TargetConditionals.h>
27 # if TARGET_OS_IPHONE
28 # define SANITIZER_IOS 1
29 # else
30 # define SANITIZER_IOS 0
31 # endif
32 #else
33 # define SANITIZER_MAC 0
34 # define SANITIZER_IOS 0
35 #endif
37 #if defined(_WIN32)
38 # define SANITIZER_WINDOWS 1
39 #else
40 # define SANITIZER_WINDOWS 0
41 #endif
43 #if defined(__ANDROID__) || defined(ANDROID)
44 # define SANITIZER_ANDROID 1
45 #else
46 # define SANITIZER_ANDROID 0
47 #endif
49 #define SANITIZER_POSIX (SANITIZER_LINUX || SANITIZER_MAC)
51 #endif // SANITIZER_PLATFORM_H