diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -1561,7 +1561,7 @@ mutable __cxx_atomic_impl<_Tp> __a_; #if defined(__cpp_lib_atomic_is_always_lock_free) - static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0); + static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), nullptr); #endif _LIBCPP_INLINE_VISIBILITY @@ -2664,7 +2664,7 @@ // atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type #ifdef __cpp_lib_atomic_is_always_lock_free -# define _LIBCPP_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), 0) +# define _LIBCPP_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), nullptr) #else # define _LIBCPP_CONTENTION_LOCK_FREE false #endif @@ -2691,7 +2691,9 @@ typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free; #endif +#undef ATOMIC_FLAG_INIT #define ATOMIC_FLAG_INIT {false} +#undef ATOMIC_VAR_INIT #define ATOMIC_VAR_INIT(__v) {__v} #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -531,8 +531,8 @@ #if _LIBCPP_STD_VER > 14 inline _LIBCPP_INLINE_VISIBILITY float hypot( float __x, float __y, float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } -inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } -inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } +inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrtf(__x*__x + __y*__y + __z*__z); } +inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrtl(__x*__x + __y*__y + __z*__z); } template inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -285,7 +285,7 @@ typedef const_reverse_iterator reverse_iterator; typedef size_t size_type; typedef ptrdiff_t difference_type; - static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1); + static _LIBCPP_CONSTEXPR const size_type npos = ~static_cast(0U); // size_type(-1); static_assert((!is_array::value), "Character type of basic_string_view must not be an array"); static_assert(( is_standard_layout::value), "Character type of basic_string_view must be standard-layout");