summaryrefslogtreecommitdiffstats
path: root/base/compat_execinfo.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 20:56:29 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 20:56:29 +0000
commit930511ae0f8ab6bc43d5e1972c884e72020bd85e (patch)
tree2a5c3eccec5a7b632ff2360b9332f55700e88ddd /base/compat_execinfo.h
parentd8cca99869c465f0567a61e43a5e69e616a26286 (diff)
downloadchromium_src-930511ae0f8ab6bc43d5e1972c884e72020bd85e.zip
chromium_src-930511ae0f8ab6bc43d5e1972c884e72020bd85e.tar.gz
chromium_src-930511ae0f8ab6bc43d5e1972c884e72020bd85e.tar.bz2
Revert accidental delete of compat_execinfo.
TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/5961007 TBR=brettw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/compat_execinfo.h')
-rw-r--r--base/compat_execinfo.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/base/compat_execinfo.h b/base/compat_execinfo.h
new file mode 100644
index 0000000..3d4cc43
--- /dev/null
+++ b/base/compat_execinfo.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A file you can include instead of <execinfo.h> if your project might need
+// to run on Mac OS X 10.4.
+
+#ifndef BASE_COMPAT_EXECINFO_H_
+#define BASE_COMPAT_EXECINFO_H_
+#pragma once
+
+#include "build/build_config.h"
+
+#if defined(OS_MACOSX)
+#include <AvailabilityMacros.h>
+#endif
+
+#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+// Manually define these here as weak imports, rather than including execinfo.h.
+// This lets us launch on 10.4 which does not have these calls.
+extern "C" {
+
+extern int backtrace(void**, int) __attribute__((weak_import));
+extern char** backtrace_symbols(void* const*, int)
+ __attribute__((weak_import));
+extern void backtrace_symbols_fd(void* const*, int, int)
+ __attribute__((weak_import));
+
+} // extern "C"
+#else
+#include <execinfo.h>
+#endif
+
+#endif // BASE_COMPAT_EXECINFO_H_