summaryrefslogtreecommitdiff
path: root/include/__cxxabi_config.h
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-12-04 02:14:58 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-12-04 02:14:58 +0000
commitb4ec5796f2d2d0c7bf3faeb87ce87281c185b28e (patch)
treea03ac48a7bc826682ba85d2832d1b844c10999e6 /include/__cxxabi_config.h
parent77a304b28be4b50a508298d6a0e40ee9d4bb3ccd (diff)
ibc++abi: mark visibility
Mark functions and types with the appropriate visibility. This is particularly useful for environments which explicitly indicate origin of functions (Windows). This aids in generating libc++abi as a DSO which exposes only the public interfaces. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@254691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/__cxxabi_config.h')
-rw-r--r--include/__cxxabi_config.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/__cxxabi_config.h b/include/__cxxabi_config.h
index 957754f..68e325f 100644
--- a/include/__cxxabi_config.h
+++ b/include/__cxxabi_config.h
@@ -17,4 +17,28 @@
#define LIBCXXABI_ARM_EHABI 0
#endif
+#if !defined(__has_attribute)
+#define __has_attribute(_attribute_) 0
+#endif
+
+#if defined(_LIBCXXABI_DLL)
+ #if defined(cxxabi_EXPORTS)
+ #define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_FUNC_VIS __declspec(dllexport)
+ #define _LIBCXXABI_TYPE_VIS __declspec(dllexport)
+ #else
+ #define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_FUNC_VIS __declspec(dllimport)
+ #define _LIBCXXABI_TYPE_VIS __declspec(dllimport)
+ #endif
+#else
+ #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
+ #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
+ #if __has_attribute(__type_visibility__)
+ #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
+ #else
+ #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
+ #endif
+#endif
+
#endif // ____CXXABI_CONFIG_H