Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/libc++abi/src/abort_message.cpp

Issue 75213003: Add libc++ and libc++abi to third-party. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 //===------------------------- abort_message.cpp --------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <stdarg.h>
13 #include "abort_message.h"
14
15 #pragma GCC visibility push(hidden)
16
17 #if __APPLE__
18 # if defined(__has_include) && __has_include(<CrashReporterClient.h>)
19 # define HAVE_CRASHREPORTERCLIENT_H 1
20 # include <CrashReporterClient.h>
21 # endif
22 #endif
23
24 __attribute__((visibility("hidden"), noreturn))
25 void abort_message(const char* format, ...)
26 {
27 // write message to stderr
28 #if __APPLE__
29 fprintf(stderr, "libc++abi.dylib: ");
30 #endif
31 va_list list;
32 va_start(list, format);
33 vfprintf(stderr, format, list);
34 va_end(list);
35 fprintf(stderr, "\n");
36
37 #if __APPLE__ && HAVE_CRASHREPORTERCLIENT_H
38 // record message in crash report
39 char* buffer;
40 va_list list2;
41 va_start(list2, format);
42 vasprintf(&buffer, format, list2);
43 va_end(list2);
44 CRSetCrashLogMessage(buffer);
45 #endif
46
47 abort();
48 }
49
50 #pragma GCC visibility pop
OLDNEW
« no previous file with comments | « third_party/libc++abi/src/abort_message.h ('k') | third_party/libc++abi/src/cxa_aux_runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698