You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling software that includes thread, using GCC 10.1.0 and libc++, I'm getting:
/usr/include/c++/v1/thread:370:65: error: operator '||' has no right operand
370 | #if defined(_LIBCPP_COMPILER_GCC) && (powerpc || POWERPC)
The reason is that POWERPC is undefined on FreeBSD. The proper way for this ifdef would be:
Index: contrib/llvm-project/libcxx/include/thread
--- contrib/llvm-project/libcxx/include/thread (revision 363109)
+++ contrib/llvm-project/libcxx/include/thread (working copy)
@@ -367,7 +367,7 @@
using namespace chrono;
if (__d > duration<_Rep, _Period>::zero())
{
-#if defined(_LIBCPP_COMPILER_GCC) && (powerpc || POWERPC)
+#if defined(_LIBCPP_COMPILER_GCC) && (defined(powerpc) || defined(POWERPC))
// GCC's long double const folding is incomplete for IBM128 long doubles.
_LIBCPP_CONSTEXPR duration _Max = nanoseconds::max();
#else
The text was updated successfully, but these errors were encountered:
[libc++] Avoid <climits> dependency in <thread>
The standard guarantees sleep durations of 2^63-1 nanoseconds to work.
Instead of depending on INT64_MAX or ULONGLONG_MAX to exist via the
header pollution, fold the constant directly. That has the additional
positive side effect that it avoids long double arithmetic bugs in GCC.
Differential Revision: https://reviews.llvm.org/D99516
Extended Description
FreeBSD head, powerpc64 elfv2, LLVM 10.0.1-rc2-0-g77d76b71d7d
When compiling software that includes thread, using GCC 10.1.0 and libc++, I'm getting:
/usr/include/c++/v1/thread:370:65: error: operator '||' has no right operand
370 | #if defined(_LIBCPP_COMPILER_GCC) && (powerpc || POWERPC)
The reason is that POWERPC is undefined on FreeBSD. The proper way for this ifdef would be:
Index: contrib/llvm-project/libcxx/include/thread
--- contrib/llvm-project/libcxx/include/thread (revision 363109)
+++ contrib/llvm-project/libcxx/include/thread (working copy)
@@ -367,7 +367,7 @@
using namespace chrono;
if (__d > duration<_Rep, _Period>::zero())
{
-#if defined(_LIBCPP_COMPILER_GCC) && (powerpc || POWERPC)
+#if defined(_LIBCPP_COMPILER_GCC) && (defined(powerpc) || defined(POWERPC))
// GCC's long double const folding is incomplete for IBM128 long doubles.
_LIBCPP_CONSTEXPR duration _Max = nanoseconds::max();
#else
The text was updated successfully, but these errors were encountered: