blob: 4296c2633e2c9286834c8e8e618ce4778c7ad047 [file] [log] [blame]
Kostya Serebryany1b712072012-05-31 14:11:07 +00001//===-- sanitizer_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//===----------------------------------------------------------------------===//
12#ifndef SANITIZER_DEFS_H
13#define SANITIZER_DEFS_H
14
15// ----------- ATTENTION -------------
16// This header should NOT include any other headers to avoid portability issues.
17
18#if defined(_WIN32)
19// FIXME find out what we need on Windows. __declspec(dllexport) ?
20#define SANITIZER_INTERFACE_FUNCTION_ATTRIBUTE
21#define SANITIZER_WEAK_ATTRIBUTE
22#else
23#define SANITIZER_INTERFACE_FUNCTION_ATTRIBUTE \
24 __attribute__((visibility("default")))
25#define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak));
26#endif
27
28// For portability reasons we do not include stddef.h, stdint.h or any other
29// system header, but we do need some basic types that are not defined
30// in a portable way by the language itself.
Kostya Serebryany1d35d152012-05-31 15:02:07 +000031typedef unsigned long uptr;
32typedef signed long sptr;
33typedef unsigned char u8;
34typedef unsigned short u16;
35typedef unsigned int u32;
36typedef unsigned long long u64;
37typedef signed char s8;
38typedef signed short s16;
39typedef signed int s32;
40typedef signed long long s64;
Kostya Serebryany1b712072012-05-31 14:11:07 +000041
42#endif // SANITIZER_DEFS_H