]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/asan/asan_globals_win.h
Merge compiler-rt trunk r291476.
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / asan / asan_globals_win.h
1 //===-- asan_globals_win.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 // Interface to the Windows-specific global management code. Separated into a
11 // standalone header to allow inclusion from asan_win_dynamic_runtime_thunk,
12 // which defines symbols that clash with other sanitizer headers.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef ASAN_GLOBALS_WIN_H
17 #define ASAN_GLOBALS_WIN_H
18
19 #if !defined(_MSC_VER)
20 #error "this file is Windows-only, and uses MSVC pragmas"
21 #endif
22
23 #if defined(_WIN64)
24 #define SANITIZER_SYM_PREFIX
25 #else
26 #define SANITIZER_SYM_PREFIX "_"
27 #endif
28
29 // Use this macro to force linking asan_globals_win.cc into the DSO.
30 #define ASAN_LINK_GLOBALS_WIN() \
31   __pragma(                     \
32       comment(linker, "/include:" SANITIZER_SYM_PREFIX "__asan_dso_reg_hook"))
33
34 #endif // ASAN_GLOBALS_WIN_H