* configure.ac: Change target-libasan to target-libsanitizer.
[official-gcc.git] / libsanitizer / include / sanitizer / common_interface_defs.h
blob4ac7609c6759d9ec66f43a7e1d7cc5c625e8241c
1 //===-- sanitizer/common_interface_defs.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 // This file is shared between AddressSanitizer and ThreadSanitizer.
9 // It contains basic macro and types.
10 // NOTE: This file may be included into user code.
11 //===----------------------------------------------------------------------===//
13 #ifndef SANITIZER_COMMON_INTERFACE_DEFS_H
14 #define SANITIZER_COMMON_INTERFACE_DEFS_H
16 // ----------- ATTENTION -------------
17 // This header should NOT include any other headers to avoid portability issues.
19 #if defined(_WIN32)
20 // FIXME find out what we need on Windows. __declspec(dllexport) ?
21 # define SANITIZER_INTERFACE_ATTRIBUTE
22 # define SANITIZER_WEAK_ATTRIBUTE
23 #elif defined(SANITIZER_GO)
24 # define SANITIZER_INTERFACE_ATTRIBUTE
25 # define SANITIZER_WEAK_ATTRIBUTE
26 #else
27 # define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
28 # define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
29 #endif
31 // __has_feature
32 #if !defined(__has_feature)
33 # define __has_feature(x) 0
34 #endif
36 // For portability reasons we do not include stddef.h, stdint.h or any other
37 // system header, but we do need some basic types that are not defined
38 // in a portable way by the language itself.
39 namespace __sanitizer {
41 #if defined(_WIN64)
42 // 64-bit Windows uses LLP64 data model.
43 typedef unsigned long long uptr; // NOLINT
44 typedef signed long long sptr; // NOLINT
45 #else
46 typedef unsigned long uptr; // NOLINT
47 typedef signed long sptr; // NOLINT
48 #endif // defined(_WIN64)
49 typedef unsigned char u8;
50 typedef unsigned short u16; // NOLINT
51 typedef unsigned int u32;
52 typedef unsigned long long u64; // NOLINT
53 typedef signed char s8;
54 typedef signed short s16; // NOLINT
55 typedef signed int s32;
56 typedef signed long long s64; // NOLINT
58 } // namespace __sanitizer
60 extern "C" {
61 // Tell the tools to write their reports to "path.<pid>" instead of stderr.
62 void __sanitizer_set_report_path(const char *path)
63 SANITIZER_INTERFACE_ATTRIBUTE;
64 } // extern "C"
66 #endif // SANITIZER_COMMON_INTERFACE_DEFS_H