OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // A file you can include instead of <execinfo.h> if your project might have |
| 6 // been compiled with our SUPPORT_MACOSX_10_4 flag defined. |
| 7 // If SUPPORT_MACOSX_10_4 is not defined it just includes execinfo.h as normal, |
| 8 // otherwise it defines the symbols itself as weak linked imports, which enables |
| 9 // launching on 10.4 where they are not defined. |
| 10 |
| 11 #ifndef BASE_COMPAT_EXECINFO_H |
| 12 #define BASE_COMPAT_EXECINFO_H |
| 13 |
| 14 #ifdef SUPPORT_MACOSX_10_4 |
| 15 // Manually define these here as weak imports, rather than including execinfo.h. |
| 16 // This lets us launch on 10.4 which does not have these calls. |
| 17 extern "C" { |
| 18 extern int backtrace(void**, int) __attribute__((weak_import)); |
| 19 extern char** backtrace_symbols(void* const*, int) |
| 20 __attribute__((weak_import)); |
| 21 extern void backtrace_symbols_fd(void* const*, int, int) |
| 22 __attribute__((weak_import)); |
| 23 } |
| 24 #else |
| 25 #include <execinfo.h> |
| 26 #endif |
| 27 |
| 28 #endif // BASE_COMPAT_EXECINFO_H |
| 29 |
OLD | NEW |