Some flag cleanup for the sanitizer runtimes.
[blocksruntime.git] / lib / sanitizer_common / sanitizer_interface_defs.h
blob2395ea5056571f0722b5ca96fad6c5e7935f41a2
1 //===-- sanitizer_interface_defs.h -----------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file is shared between AddressSanitizer and ThreadSanitizer.
11 // It contains basic macro and types.
12 // NOTE: This file may be included into user code.
13 //===----------------------------------------------------------------------===//
15 #ifndef SANITIZER_INTERFACE_DEFS_H
16 #define SANITIZER_INTERFACE_DEFS_H
18 // ----------- ATTENTION -------------
19 // This header should NOT include any other headers to avoid portability issues.
21 #if defined(_WIN32)
22 // FIXME find out what we need on Windows. __declspec(dllexport) ?
23 # define SANITIZER_INTERFACE_ATTRIBUTE
24 # define SANITIZER_WEAK_ATTRIBUTE
25 #elif defined(SANITIZER_GO)
26 # define SANITIZER_INTERFACE_ATTRIBUTE
27 # define SANITIZER_WEAK_ATTRIBUTE
28 #else
29 # define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
30 # define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
31 #endif
33 // __has_feature
34 #if !defined(__has_feature)
35 # define __has_feature(x) 0
36 #endif
38 // For portability reasons we do not include stddef.h, stdint.h or any other
39 // system header, but we do need some basic types that are not defined
40 // in a portable way by the language itself.
41 namespace __sanitizer {
43 typedef unsigned long uptr; // NOLINT
44 typedef signed long sptr; // NOLINT
45 typedef unsigned char u8;
46 typedef unsigned short u16; // NOLINT
47 typedef unsigned int u32;
48 typedef unsigned long long u64; // NOLINT
49 typedef signed char s8;
50 typedef signed short s16; // NOLINT
51 typedef signed int s32;
52 typedef signed long long s64; // NOLINT
54 } // namespace __sanitizer
56 #endif // SANITIZER_INTERFACE_DEFS_H