@@ -622,4 +622,22 @@ namespace std
#define _GLIBCXX_USE_FLOAT128
#endif
+#if __GNUC__ >= 7
+// Assume these are available if the compiler claims to be a recent GCC:
+# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
+# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
+# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
+#elif defined(__is_identifier)
+// For non-GNU compilers:
+# if ! __is_identifier(__has_unique_object_representations)
+# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
+# endif
+# if ! __is_identifier(__is_aggregate)
+# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
+# endif
+# if ! __is_identifier(__builtin_launder)
+# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
+# endif
+#endif // GCC
+
// End of prewritten config; the settings discovered at configure time follow.
@@ -2956,15 +2956,6 @@ template <typename _Base, typename _Derived>
template <typename _From, typename _To>
inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
-#if __GNUC__ >= 7
-# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
-#elif defined(__is_identifier)
-// For non-GNU compilers:
-# if ! __is_identifier(__has_unique_object_representations)
-# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
-# endif
-#endif
-
#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
# define __cpp_lib_has_unique_object_representations 201606
/// has_unique_object_representations
@@ -2979,19 +2970,9 @@ template <typename _From, typename _To>
inline constexpr bool has_unique_object_representations_v
= has_unique_object_representations<_Tp>::value;
#endif
-#undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
-
-#if __GNUC__ >= 7
-# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
-#elif defined(__is_identifier)
-// For non-GNU compilers:
-# if ! __is_identifier(__is_aggregate)
-# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
-# endif
-#endif
#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
-#define __cpp_lib_is_aggregate 201703
+# define __cpp_lib_is_aggregate 201703
/// is_aggregate
template<typename _Tp>
struct is_aggregate
@@ -3001,8 +2982,6 @@ template <typename _From, typename _To>
template<typename _Tp>
inline constexpr bool is_aggregate_v = is_aggregate<_Tp>::value;
#endif
-#undef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
-
#endif // C++17
#if __cplusplus > 201703L
@@ -73,7 +73,9 @@
#define __cpp_lib_make_unique 201304
#define __cpp_lib_quoted_string_io 201304
#define __cpp_lib_robust_nonmodifying_seq_ops 201304
-#define __cpp_lib_shared_timed_mutex 201402
+#ifdef _GLIBCXX_HAS_GTHREADS
+# define __cpp_lib_shared_timed_mutex 201402
+#endif
#define __cpp_lib_string_udls 201304
#define __cpp_lib_transformation_trait_aliases 201304
#define __cpp_lib_transparent_operators 201510
@@ -97,13 +99,19 @@
#define __cpp_lib_filesystem 201703
#define __cpp_lib_gcd 201606
#define __cpp_lib_gcd_lcm 201606
-#define __cpp_lib_has_unique_object_representations 201606
+#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
+# define __cpp_lib_has_unique_object_representations 201606
+#endif
#define __cpp_lib_hypot 201603
#define __cpp_lib_invoke 201411
-#define __cpp_lib_is_aggregate 201703
+#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
+# define __cpp_lib_is_aggregate 201703
+#endif
#define __cpp_lib_is_invocable 201703
#define __cpp_lib_is_swappable 201603
-#define __cpp_lib_launder 201606
+#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
+# define __cpp_lib_launder 201606
+#endif
#define __cpp_lib_lcm 201606
#define __cpp_lib_logical_traits 201510
#define __cpp_lib_make_from_tuple 201606
@@ -115,8 +123,10 @@
#define __cpp_lib_not_fn 201603
#define __cpp_lib_optional 201603
#define __cpp_lib_sample 201603
-#define __cpp_lib_scoped_lock 201703
-#define __cpp_lib_shared_mutex 201505
+#ifdef _GLIBCXX_HAS_GTHREADS
+# define __cpp_lib_scoped_lock 201703
+# define __cpp_lib_shared_mutex 201505
+#endif
#define __cpp_lib_shared_ptr_weak_type 201606
#define __cpp_lib_string_view 201603
#define __cpp_lib_type_trait_variable_templates 201510L
@@ -182,15 +182,6 @@ inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { }
} // extern "C++"
#if __cplusplus >= 201703L
-#if __GNUC__ >= 7
-# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
-#elif defined __has_builtin
-// For non-GNU compilers:
-# if __has_builtin(__builtin_launder)
-# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
-# endif
-#endif
-
#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
namespace std
{
@@ -215,7 +206,6 @@ namespace std
void launder(const volatile void*) = delete;
}
#endif // _GLIBCXX_HAVE_BUILTIN_LAUNDER
-#undef _GLIBCXX_HAVE_BUILTIN_LAUNDER
#endif // C++17
#pragma GCC visibility pop