Skip to content

Commit 15fa9ec

Browse files
committed
Wrap around c++26 macro and test fix
1 parent 0546b76 commit 15fa9ec

File tree

14 files changed

+82
-32
lines changed

14 files changed

+82
-32
lines changed

libcxx/include/__chrono/day.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,17 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no
9393

9494
} // namespace chrono
9595

96+
# if _LIBCPP_STD_VER >= 26
97+
9698
template <>
9799
struct hash<chrono::day> : public __unary_function<chrono::day, size_t> {
98100
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::day& __d) const _NOEXCEPT {
99101
return hash<unsigned>{}(static_cast<unsigned>(__d));
100102
}
101103
};
102104

105+
# endif // _LIBCPP_STD_VER >= 26
106+
103107
_LIBCPP_END_NAMESPACE_STD
104108

105109
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/duration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ using namespace literals::chrono_literals;
539539

540540
#endif // _LIBCPP_STD_VER >= 14
541541

542-
#if _LIBCPP_STD_VER >= 20
542+
#if _LIBCPP_STD_VER >= 26
543543

544544
template <class _Rep, class _Period>
545545
requires __has_enabled_hash<_Rep>::value
@@ -549,7 +549,7 @@ struct hash<chrono::duration<_Rep, _Period>> : public __unary_function<chrono::d
549549
}
550550
};
551551

552-
#endif // _LIBCPP_STD_VER >= 20
552+
#endif // _LIBCPP_STD_VER >= 26
553553

554554
_LIBCPP_END_NAMESPACE_STD
555555

libcxx/include/__chrono/leap_second.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,17 @@ class leap_second {
123123

124124
} // namespace chrono
125125

126+
# if _LIBCPP_STD_VER >= 26
127+
126128
template <>
127129
struct hash<chrono::leap_second> : public __unary_function<chrono::leap_second, size_t> {
128130
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::leap_second& __lp) const _NOEXCEPT {
129131
return hash<chrono::seconds>{}(__lp.value());
130132
}
131133
};
132134

135+
# endif // _LIBCPP_STD_VER >= 26
136+
133137
# endif // _LIBCPP_STD_VER >= 20
134138

135139
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__chrono/month.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,17 @@ inline constexpr month December{12};
109109

110110
} // namespace chrono
111111

112+
# if _LIBCPP_STD_VER >= 26
113+
112114
template <>
113115
struct hash<chrono::month> : public __unary_function<chrono::month, size_t> {
114116
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month& __m) const _NOEXCEPT {
115117
return hash<unsigned>{}(static_cast<unsigned>(__m));
116118
}
117119
};
118120

121+
# endif // _LIBCPP_STD_VER >= 26
122+
119123
_LIBCPP_END_NAMESPACE_STD
120124

121125
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/month_weekday.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda
9999
}
100100
} // namespace chrono
101101

102+
# if _LIBCPP_STD_VER >= 26
103+
102104
template <>
103105
struct hash<chrono::month_weekday> : public __unary_function<chrono::month_weekday, size_t> {
104106
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_weekday& __mw) const _NOEXCEPT {
@@ -113,6 +115,8 @@ struct hash<chrono::month_weekday_last> : public __unary_function<chrono::month_
113115
}
114116
};
115117

118+
# endif // _LIBCPP_STD_VER >= 26
119+
116120
_LIBCPP_END_NAMESPACE_STD
117121

118122
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/monthday.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _
127127

128128
} // namespace chrono
129129

130+
# if _LIBCPP_STD_VER >= 26
131+
130132
template <>
131133
struct hash<chrono::month_day> : public __unary_function<chrono::month_day, size_t> {
132134
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_day& __md) const _NOEXCEPT {
@@ -141,6 +143,8 @@ struct hash<chrono::month_day_last> : public __unary_function<chrono::month_day_
141143
}
142144
};
143145

146+
# endif // _LIBCPP_STD_VER >= 26
147+
144148
_LIBCPP_END_NAMESPACE_STD
145149

146150
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/time_point.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
225225

226226
} // namespace chrono
227227

228-
#if _LIBCPP_STD_VER >= 20
228+
#if _LIBCPP_STD_VER >= 26
229229

230230
template <class _Clock, class _Duration>
231231
requires __has_enabled_hash<_Duration>::value
@@ -236,7 +236,7 @@ struct hash<chrono::time_point<_Clock, _Duration>>
236236
}
237237
};
238238

239-
#endif // _LIBCPP_STD_VER >= 20
239+
#endif // _LIBCPP_STD_VER >= 26
240240

241241
_LIBCPP_END_NAMESPACE_STD
242242

libcxx/include/__chrono/weekday.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ inline constexpr weekday Saturday{6};
161161

162162
} // namespace chrono
163163

164+
# if _LIBCPP_STD_VER >= 26
165+
164166
template <>
165167
struct hash<chrono::weekday> : public __unary_function<chrono::weekday, size_t> {
166168
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::weekday& __w) const _NOEXCEPT {
@@ -182,6 +184,8 @@ struct hash<chrono::weekday_last> : public __unary_function<chrono::weekday_last
182184
}
183185
};
184186

187+
# endif // _LIBCPP_STD_VER >= 26
188+
185189
_LIBCPP_END_NAMESPACE_STD
186190

187191
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/year.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
110110

111111
} // namespace chrono
112112

113+
# if _LIBCPP_STD_VER >= 26
114+
113115
template <>
114116
struct hash<chrono::year> : public __unary_function<chrono::year, size_t> {
115117
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::year& __y) const _NOEXCEPT {
116118
return hash<int>{}(static_cast<int>(__y));
117119
}
118120
};
119121

122+
# endif // _LIBCPP_STD_VER >= 26
123+
120124
_LIBCPP_END_NAMESPACE_STD
121125

122126
#endif // _LIBCPP_STD_VER >= 20

libcxx/include/__chrono/year_month.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,17 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& year_month::operator-=(const
117117

118118
} // namespace chrono
119119

120+
# if _LIBCPP_STD_VER >= 26
121+
120122
template <>
121123
struct hash<chrono::year_month> : public __unary_function<chrono::year_month, size_t> {
122124
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::year_month& __ym) const _NOEXCEPT {
123125
return hash<chrono::year>{}(__ym.year()) ^ hash<chrono::month>{}(__ym.month());
124126
}
125127
};
126128

129+
# endif // _LIBCPP_STD_VER >= 26
130+
127131
_LIBCPP_END_NAMESPACE_STD
128132

129133
#endif // _LIBCPP_STD_VER >= 20

0 commit comments

Comments
 (0)