summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxxabi/src/config.h')
-rw-r--r--libcxxabi/src/config.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libcxxabi/src/config.h b/libcxxabi/src/config.h
index 5d38d4d1465..d30c49b57ea 100644
--- a/libcxxabi/src/config.h
+++ b/libcxxabi/src/config.h
@@ -16,6 +16,36 @@
#include <unistd.h>
+// Configure inline visibility attributes
+#if defined(_WIN32)
+ #if defined(_MSC_VER) && !defined(__clang__)
+ // Using Microsoft Visual C++ compiler
+ #define _LIBCXXABI_INLINE_VISIBILITY __forceinline
+ #else
+ #if __has_attribute(__internal_linkage__)
+ #define _LIBCXXABI_INLINE_VISIBILITY __attribute__ ((__internal_linkage__, __always_inline__))
+ #else
+ #define _LIBCXXABI_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+ #endif
+ #endif
+#else
+ #if __has_attribute(__internal_linkage__)
+ #define _LIBCXXABI_INLINE_VISIBILITY __attribute__ ((__internal_linkage__, __always_inline__))
+ #else
+ #define _LIBCXXABI_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+ #endif
+#endif
+
+// Try and deduce a threading api if one has not been explicitly set.
+#if !defined(_LIBCXXABI_HAS_NO_THREADS) && \
+ !defined(_LIBCXXABI_USE_THREAD_API_PTHREAD)
+ #if defined(_POSIX_THREADS) && _POSIX_THREADS >= 0
+ #define _LIBCXXABI_USE_THREAD_API_PTHREAD
+ #else
+ #error "No thread API"
+ #endif
+#endif
+
// Set this in the CXXFLAGS when you need it, because otherwise we'd have to
// #if !defined(__linux__) && !defined(__APPLE__) && ...
// and so-on for *every* platform.
OpenPOWER on IntegriCloud