blob: d72bb52d0e86fcec6e6580eb4b9271eefb510800 [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.
Alexey Samsonovb6e4f362012-06-04 14:35:09 +000031typedef unsigned long uptr; // NOLINT
32typedef signed long sptr; // NOLINT
Kostya Serebryany1d35d152012-05-31 15:02:07 +000033typedef unsigned char u8;
Alexey Samsonovb6e4f362012-06-04 14:35:09 +000034typedef unsigned short u16; // NOLINT
Kostya Serebryany1d35d152012-05-31 15:02:07 +000035typedef unsigned int u32;
Alexey Samsonovb6e4f362012-06-04 14:35:09 +000036typedef unsigned long long u64; // NOLINT
Kostya Serebryany1d35d152012-05-31 15:02:07 +000037typedef signed char s8;
Alexey Samsonovb6e4f362012-06-04 14:35:09 +000038typedef signed short s16; // NOLINT
Kostya Serebryany1d35d152012-05-31 15:02:07 +000039typedef signed int s32;
Alexey Samsonovb6e4f362012-06-04 14:35:09 +000040typedef signed long long s64; // NOLINT
Kostya Serebryany1b712072012-05-31 14:11:07 +000041
42#endif // SANITIZER_DEFS_H