OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A file you can include instead of <execinfo.h> if your project might need | 5 // A file you can include instead of <execinfo.h> if your project might need |
6 // to run on Mac OS X 10.4. | 6 // to run on Mac OS X 10.4. |
7 | 7 |
8 #ifndef BASE_COMPAT_EXECINFO_H_ | 8 #ifndef BASE_COMPAT_EXECINFO_H |
9 #define BASE_COMPAT_EXECINFO_H_ | 9 #define BASE_COMPAT_EXECINFO_H |
10 | 10 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 | 12 |
13 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
14 #include <AvailabilityMacros.h> | 14 #include <AvailabilityMacros.h> |
15 #endif | 15 #endif |
16 | 16 |
17 #if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 | 17 #if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 |
18 // Manually define these here as weak imports, rather than including execinfo.h. | 18 // Manually define these here as weak imports, rather than including execinfo.h. |
19 // This lets us launch on 10.4 which does not have these calls. | 19 // This lets us launch on 10.4 which does not have these calls. |
20 extern "C" { | 20 extern "C" { |
21 | 21 |
22 extern int backtrace(void**, int) __attribute__((weak_import)); | 22 extern int backtrace(void**, int) __attribute__((weak_import)); |
23 extern char** backtrace_symbols(void* const*, int) | 23 extern char** backtrace_symbols(void* const*, int) |
24 __attribute__((weak_import)); | 24 __attribute__((weak_import)); |
25 extern void backtrace_symbols_fd(void* const*, int, int) | 25 extern void backtrace_symbols_fd(void* const*, int, int) |
26 __attribute__((weak_import)); | 26 __attribute__((weak_import)); |
27 | 27 |
28 } // extern "C" | 28 } // extern "C" |
29 #else | 29 #else |
30 #include <execinfo.h> | 30 #include <execinfo.h> |
31 #endif | 31 #endif |
32 | 32 |
33 #endif // BASE_COMPAT_EXECINFO_H_ | 33 #endif // BASE_COMPAT_EXECINFO_H |
OLD | NEW |