aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-09 19:54:57 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-09 19:54:57 +0000
commitccdb2a5e0ab4b0a7fc9d3859c6bb1676182169d5 (patch)
tree0a6e21ff31e6a0fc48f377a7990401d6acb2a4bb
parentbeac9e3772e255f89dad0abe34811953121912b2 (diff)
unwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS is specified.
For GCC compatibility. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171991 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Headers/unwind.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 55ebd54a67..dbdbaf4777 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -23,6 +23,9 @@
/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#if __has_include_next(<unwind.h>)
/* Darwin and libunwind provide an unwind.h. If that's available, use
* it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
@@ -59,7 +62,9 @@ extern "C" {
/* It is a bit strange for a header to play with the visibility of the
symbols it declares, but this matches gcc's behavior and some programs
depend on it */
+#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default)
+#endif
struct _Unwind_Context;
typedef enum {
@@ -115,10 +120,14 @@ uintptr_t _Unwind_GetIP(struct _Unwind_Context* context);
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context*, void*);
_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void*);
+#ifndef HIDE_EXPORTS
#pragma GCC visibility pop
+#endif
#ifdef __cplusplus
}
#endif
#endif
+
+#endif /* __CLANG_UNWIND_H */