From 7bc5ecf049e129b43bf16c589d8bed8687d992d6 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Sun, 19 Mar 2023 15:29:33 +0100 Subject: libstdc++ 11 lacks stream operators for duration. Use same workaround as for old libc++ versions. --- vespalib/src/vespa/vespalib/util/time.cpp | 3 ++- vespalib/src/vespa/vespalib/util/time.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'vespalib/src') diff --git a/vespalib/src/vespa/vespalib/util/time.cpp b/vespalib/src/vespa/vespalib/util/time.cpp index 42155647870..cba26f24059 100644 --- a/vespalib/src/vespa/vespalib/util/time.cpp +++ b/vespalib/src/vespa/vespalib/util/time.cpp @@ -93,9 +93,10 @@ Timer::waitAtLeast(duration dur, bool busyWait) { } -#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 160000 +#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 160000) || (!defined(_LIBCPP_VERSION) && defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12) // Temporary workaround until libc++ supports stream operators for duration +// Temporary workaround while using libstdc++ 11 #include diff --git a/vespalib/src/vespa/vespalib/util/time.h b/vespalib/src/vespa/vespalib/util/time.h index 2cb53df8ae2..b893661832f 100644 --- a/vespalib/src/vespa/vespalib/util/time.h +++ b/vespalib/src/vespa/vespalib/util/time.h @@ -101,9 +101,10 @@ duration adjustTimeoutByHz(duration timeout, long hz); } -#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 160000 +#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 160000) || (!defined(_LIBCPP_VERSION) && defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12) // Temporary workaround until libc++ supports stream operators for duration +// Temporary workaround while using libstdc++ 11 #include -- cgit v1.2.3