blob: 5e08ef3c66fd64aef3bceee4bce3ba439af102ab [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.
31typedef unsigned long uptr; // Unsigned integer of the same size as a pointer.
32// FIXME: add u64, u32, etc.
33
34#endif // SANITIZER_DEFS_H