Skip to content

Commit e55cae6

Browse files
authored
Merge pull request #36602 from vespa-engine/toregge/drop-old-workarounds
Drop old workarounds.
2 parents d5a8c1e + 5d55f5f commit e55cae6

3 files changed

Lines changed: 0 additions & 45 deletions

File tree

document/src/vespa/document/select/parse_utils.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,12 @@ bool parse_i64(const char* str, size_t len, int64_t& out) {
2424
}
2525

2626
bool parse_double(const char* str, size_t len, double& out) {
27-
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 200000
28-
// Temporary workaround that also handles underflow (cf. issue 3081)
29-
// until libc++ supports std::from_chars for double
30-
char* str_end = const_cast<char*>(str) + len;
31-
double out0 = vespalib::locale::c::strtod_au(str, &str_end);
32-
if (str_end != str + len) {
33-
return false;
34-
}
35-
out = out0;
36-
return true;
37-
#else
3827
auto res = std::from_chars(str, str + len, out);
3928
if (res.ec == std::errc::result_out_of_range) {
4029
out = (str[0] == '-') ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity();
4130
return true;
4231
}
4332
return (res.ec == std::errc()) && (res.ptr == str + len);
44-
#endif
4533
}
4634

4735
} // namespace document::select::util

vespalib/src/vespa/vespalib/util/time.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,3 @@ void Timer::waitAtLeast(duration dur, bool busyWait) {
9292
}
9393

9494
} // namespace vespalib
95-
96-
#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 170000) || \
97-
(!defined(_LIBCPP_VERSION) && defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12)
98-
99-
// Temporary workaround until libc++ supports stream operators for duration
100-
// Temporary workaround while using libstdc++ 11
101-
102-
#include <ostream>
103-
104-
namespace std::chrono {
105-
106-
ostream& operator<<(ostream& os, const nanoseconds& value) {
107-
os << value.count() << "ns";
108-
return os;
109-
}
110-
111-
} // namespace std::chrono
112-
#endif

vespalib/src/vespa/vespalib/util/time.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,3 @@ duration adjustTimeoutByDetectedHz(duration timeout);
104104
duration adjustTimeoutByHz(duration timeout, long hz);
105105

106106
} // namespace vespalib
107-
108-
#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 170000) || \
109-
(!defined(_LIBCPP_VERSION) && defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12)
110-
111-
// Temporary workaround until libc++ supports stream operators for duration
112-
// Temporary workaround while using libstdc++ 11
113-
114-
#include <iosfwd>
115-
116-
namespace std::chrono {
117-
118-
ostream& operator<<(ostream& os, const nanoseconds& value);
119-
120-
}
121-
#endif

0 commit comments

Comments
 (0)