Skip to content

Commit 2a780e8

Browse files
committed
[libc++] Include headers in <thread> conditionally
1 parent 8111867 commit 2a780e8

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

libcxx/include/thread

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
9090

9191
#if _LIBCPP_HAS_THREADS
9292

93-
# include <__thread/formatter.h>
94-
# include <__thread/jthread.h>
95-
# include <__thread/support.h>
9693
# include <__thread/this_thread.h>
9794
# include <__thread/thread.h>
95+
96+
# if _LIBCPP_STD_VER >= 20
97+
# include <__thread/jthread.h>
98+
# endif
99+
100+
# if _LIBCPP_STD_VER >= 23
101+
# include <__thread/formatter.h>
102+
# endif
103+
98104
# include <version>
99105

100106
// standard-mandated includes
@@ -108,13 +114,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
108114

109115
#endif // _LIBCPP_HAS_THREADS
110116

111-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
112-
# include <cstddef>
113-
# include <ctime>
114-
# include <iosfwd>
115-
# include <ratio>
116-
#endif
117-
118117
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
119118
# include <chrono>
120119
#endif

0 commit comments

Comments
 (0)