blob: 86a9956683d08411f7b13e5fa4b1fd74204681cf [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001//===-- sanitizer_mac.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 various sanitizers' runtime libraries and
11// provides definitions for OSX-specific functions.
12//===----------------------------------------------------------------------===//
13#ifndef SANITIZER_MAC_H
14#define SANITIZER_MAC_H
15
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080016#include "sanitizer_common.h"
Stephen Hines2d1fdb22014-05-28 23:58:16 -070017#include "sanitizer_platform.h"
18#if SANITIZER_MAC
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070019#include "sanitizer_posix.h"
Stephen Hines2d1fdb22014-05-28 23:58:16 -070020
21namespace __sanitizer {
22
23enum MacosVersion {
24 MACOS_VERSION_UNINITIALIZED = 0,
25 MACOS_VERSION_UNKNOWN,
26 MACOS_VERSION_LEOPARD,
27 MACOS_VERSION_SNOW_LEOPARD,
28 MACOS_VERSION_LION,
29 MACOS_VERSION_MOUNTAIN_LION,
Stephen Hines6d186232014-11-26 17:56:19 -080030 MACOS_VERSION_MAVERICKS,
31 MACOS_VERSION_YOSEMITE,
Stephen Hines86277eb2015-03-23 12:06:32 -070032 MACOS_VERSION_UNKNOWN_NEWER
Stephen Hines2d1fdb22014-05-28 23:58:16 -070033};
34
35MacosVersion GetMacosVersion();
36
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080037char **GetEnviron();
38
Stephen Hines2d1fdb22014-05-28 23:58:16 -070039} // namespace __sanitizer
40
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080041extern "C" {
42static char __crashreporter_info_buff__[kErrorMessageBufferSize] = {};
43static const char *__crashreporter_info__ __attribute__((__used__)) =
44 &__crashreporter_info_buff__[0];
45asm(".desc ___crashreporter_info__, 0x10");
46} // extern "C"
47
48INLINE void CRSetCrashLogMessage(const char *msg) {
49 internal_strlcpy(__crashreporter_info_buff__, msg,
50 sizeof(__crashreporter_info_buff__)); }
51
Stephen Hines2d1fdb22014-05-28 23:58:16 -070052#endif // SANITIZER_MAC
53#endif // SANITIZER_MAC_H