diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -362,12 +362,11 @@ { if (__d > chrono::duration<_Rep, _Period>::zero()) { -#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__) - // GCC's long double const folding is incomplete for IBM128 long doubles. - _LIBCPP_CONSTEXPR chrono::duration _Max = chrono::duration(ULLONG_MAX/1000000000ULL) ; -#else - _LIBCPP_CONSTEXPR chrono::duration _Max = chrono::nanoseconds::max(); -#endif + // The standard guarantees a 64bit signed integer resolution for nanoseconds, + // so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid + // and issues with long double folding on PowerPC with GCC. + _LIBCPP_CONSTEXPR chrono::duration _Max = + chrono::duration(9223372036.0L); chrono::nanoseconds __ns; if (__d < _Max) {