summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-03-19 15:29:33 +0100
committerTor Egge <Tor.Egge@online.no>2023-03-19 15:29:33 +0100
commit7bc5ecf049e129b43bf16c589d8bed8687d992d6 (patch)
tree559d8519596d369c46151b1b53217f584ca2bd89
parentaab857d9767717a05dcfe80a87fb0d564c6e343e (diff)
libstdc++ 11 lacks stream operators for duration. Use same workaround
as for old libc++ versions.
-rw-r--r--vespalib/src/vespa/vespalib/util/time.cpp3
-rw-r--r--vespalib/src/vespa/vespalib/util/time.h3
2 files changed, 4 insertions, 2 deletions
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 <ostream>
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 <iosfwd>