Add libstdc++-raw-cxx.m4 and use it in libsanitizer
[gcc.git] / libsanitizer / asan / asan_mac.h
1 //===-- asan_mac.h ----------------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is a part of AddressSanitizer, an address sanity checker.
9 //
10 // Mac-specific ASan definitions.
11 //===----------------------------------------------------------------------===//
12 #ifndef ASAN_MAC_H
13 #define ASAN_MAC_H
14
15 // CF_RC_BITS, the layout of CFRuntimeBase and __CFStrIsConstant are internal
16 // and subject to change in further CoreFoundation versions. Apple does not
17 // guarantee any binary compatibility from release to release.
18
19 // See http://opensource.apple.com/source/CF/CF-635.15/CFInternal.h
20 #if defined(__BIG_ENDIAN__)
21 #define CF_RC_BITS 0
22 #endif
23
24 #if defined(__LITTLE_ENDIAN__)
25 #define CF_RC_BITS 3
26 #endif
27
28 // See http://opensource.apple.com/source/CF/CF-635.15/CFRuntime.h
29 typedef struct __CFRuntimeBase {
30 uptr _cfisa;
31 u8 _cfinfo[4];
32 #if __LP64__
33 u32 _rc;
34 #endif
35 } CFRuntimeBase;
36
37 enum {
38 MACOS_VERSION_UNKNOWN = 0,
39 MACOS_VERSION_LEOPARD,
40 MACOS_VERSION_SNOW_LEOPARD,
41 MACOS_VERSION_LION,
42 MACOS_VERSION_MOUNTAIN_LION
43 };
44
45 // Used by asan_malloc_mac.cc and asan_mac.cc
46 extern "C" void __CFInitialize();
47
48 namespace __asan {
49
50 int GetMacosVersion();
51 void MaybeReplaceCFAllocator();
52
53 } // namespace __asan
54
55 #endif // ASAN_MAC_H