aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/__config
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/__config')
-rw-r--r--system/include/libcxx/__config47
1 files changed, 29 insertions, 18 deletions
diff --git a/system/include/libcxx/__config b/system/include/libcxx/__config
index 8617b866..959390d5 100644
--- a/system/include/libcxx/__config
+++ b/system/include/libcxx/__config
@@ -11,7 +11,7 @@
#ifndef _LIBCPP_CONFIG
#define _LIBCPP_CONFIG
-#if !_MSC_VER // explicit macro necessary because it is only defined below in this file
+#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file
#pragma GCC system_header
#endif
@@ -96,24 +96,27 @@
# endif
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
-#if _WIN32
+#ifdef _WIN32
// only really useful for a DLL
#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
# ifdef cxx_EXPORTS
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE __declspec(dllexport)
+# define _LIBCPP_FUNC_VIS __declspec(dllexport)
+# define _LIBCPP_TYPE_VIS __declspec(dllexport)
# else
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE __declspec(dllimport)
+# define _LIBCPP_FUNC_VIS __declspec(dllimport)
+# define _LIBCPP_TYPE_VIS __declspec(dllimport)
# endif
#else
# define _LIBCPP_HIDDEN
-# define _LIBCPP_VISIBLE
+# define _LIBCPP_FUNC_VIS
+# define _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_INLINE_VISIBILITY
-# if _MSC_VER
+# ifdef _MSC_VER
# define _LIBCPP_INLINE_VISIBILITY __forceinline
# else // MinGW GCC and Clang
# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
@@ -121,11 +124,11 @@
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_ALWAYS_INLINE
-# if _MSC_VER
+# ifdef _MSC_VER
# define _LIBCPP_ALWAYS_INLINE __forceinline
# endif
#endif
@@ -136,8 +139,16 @@
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
#endif
-#ifndef _LIBCPP_VISIBLE
-#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default")))
+#ifndef _LIBCPP_FUNC_VIS
+#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
+#endif
+
+#ifndef _LIBCPP_TYPE_VIS
+# if __has_attribute(type_visibility)
+# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
+# endif
#endif
#ifndef _LIBCPP_INLINE_VISIBILITY
@@ -145,7 +156,7 @@
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
#endif
#ifndef _LIBCPP_CANTTHROW
@@ -261,7 +272,7 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_CONSTEXPR
#endif
-#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
+#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
#endif
@@ -424,7 +435,7 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
__lx __v_; \
_LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
@@ -432,7 +443,7 @@ template <unsigned> struct __static_assert_check {};
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
};
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
@@ -440,18 +451,18 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
-#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
-#if __FreeBSD__
+#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
-#if __APPLE__ || __FreeBSD__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
#endif
-#if __APPLE__ || __FreeBSD__ || __sun__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
#define _LIBCPP_WCTYPE_IS_MASK
#endif