Kostya Serebryany | 1b71207 | 2012-05-31 14:11:07 +0000 | [diff] [blame] | 1 | //===-- 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 Serebryany | 1d35d15 | 2012-05-31 15:02:07 +0000 | [diff] [blame^] | 31 | typedef unsigned long uptr; |
| 32 | typedef signed long sptr; |
| 33 | typedef unsigned char u8; |
| 34 | typedef unsigned short u16; |
| 35 | typedef unsigned int u32; |
| 36 | typedef unsigned long long u64; |
| 37 | typedef signed char s8; |
| 38 | typedef signed short s16; |
| 39 | typedef signed int s32; |
| 40 | typedef signed long long s64; |
Kostya Serebryany | 1b71207 | 2012-05-31 14:11:07 +0000 | [diff] [blame] | 41 | |
| 42 | #endif // SANITIZER_DEFS_H |