summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2017-06-27 18:37:06 +0000
committerNico Weber <nicolasweber@gmx.de>2017-06-27 18:37:06 +0000
commit41f982e5887185b904a456e20dfcd58e6be6cc19 (patch)
treed31298428a1fc4684f8032236287c16e6110b3ae
parentda5936d515cf12d2776a336a928940471147244d (diff)
[libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS
It's useful to be able to disable visibility annotations entirely; for example, if we're building libunwind static to include in another library, and we don't want any libunwind functions getting exported out of that library. https://reviews.llvm.org/D34637 Patch from Thomas Anderson <thomasanderson@chromium.org>! git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@306442 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/config.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/config.h b/src/config.h
index 4be98c8..ac8d7d9 100644
--- a/src/config.h
+++ b/src/config.h
@@ -44,9 +44,14 @@
#endif
#endif
-// FIXME: these macros are not correct for COFF targets
-#define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
-#define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS)
+ #define _LIBUNWIND_EXPORT
+ #define _LIBUNWIND_HIDDEN
+#else
+ // FIXME: these macros are not correct for COFF targets
+ #define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
+ #define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+#endif
#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
#define _LIBUNWIND_BUILD_SJLJ_APIS