|
87 | 87 |
|
88 | 88 | #if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) |
89 | 89 |
|
90 | | - // These macros control the availability of std::bad_optional_access and |
91 | | - // other exception types. These were put in the shared library to prevent |
92 | | - // code bloat from every user program defining the vtable for these exception |
93 | | - // types. |
94 | | - // |
95 | | - // Note that when exceptions are disabled, the methods that normally throw |
96 | | - // these exceptions can be used even on older deployment targets, but those |
97 | | - // methods will abort instead of throwing. |
98 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS |
99 | | -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
100 | | - |
101 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS |
102 | | -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS |
103 | | - |
104 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST |
105 | | -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST |
106 | | - |
107 | | - // These macros control the availability of all parts of <filesystem> that |
108 | | - // depend on something in the dylib. |
109 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY |
110 | | -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY |
111 | | -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH |
112 | | -# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP |
113 | | - |
114 | | - // This controls the availability of floating-point std::to_chars functions. |
115 | | - // These overloads were added later than the integer overloads. |
116 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT |
117 | | -# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT |
118 | | - |
119 | | - // This controls the availability of the C++20 synchronization library, |
120 | | - // which requires shared library support for various operations |
121 | | - // (see libcxx/src/atomic.cpp). This includes <barier>, <latch>, |
122 | | - // <semaphore>, and notification functions on std::atomic. |
123 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_SYNC |
124 | | -# define _LIBCPP_AVAILABILITY_SYNC |
125 | | - |
126 | | - // This controls whether the library claims to provide a default verbose |
127 | | - // termination function, and consequently whether the headers will try |
128 | | - // to use it when the mechanism isn't overriden at compile-time. |
129 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT |
130 | | -# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT |
131 | | - |
132 | | - // This controls the availability of the C++17 std::pmr library, |
133 | | - // which is implemented in large part in the built library. |
134 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_PMR |
135 | | -# define _LIBCPP_AVAILABILITY_PMR |
136 | | - |
137 | | - // This controls the availability of the C++20 time zone database. |
138 | | - // The parser code is built in the library. |
139 | | -// # define _LIBCPP_AVAILABILITY_HAS_NO_TZDB |
140 | | -# define _LIBCPP_AVAILABILITY_TZDB |
| 90 | +// These macros control the availability of std::bad_optional_access and |
| 91 | +// other exception types. These were put in the shared library to prevent |
| 92 | +// code bloat from every user program defining the vtable for these exception |
| 93 | +// types. |
| 94 | +// |
| 95 | +// Note that when exceptions are disabled, the methods that normally throw |
| 96 | +// these exceptions can be used even on older deployment targets, but those |
| 97 | +// methods will abort instead of throwing. |
| 98 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS 1 |
| 99 | +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
| 100 | + |
| 101 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS 1 |
| 102 | +# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS |
| 103 | + |
| 104 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST 1 |
| 105 | +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST |
| 106 | + |
| 107 | +// These macros control the availability of all parts of <filesystem> that |
| 108 | +// depend on something in the dylib. |
| 109 | +# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 1 |
| 110 | +# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY |
| 111 | +# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH |
| 112 | +# define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP |
| 113 | + |
| 114 | +// This controls the availability of floating-point std::to_chars functions. |
| 115 | +// These overloads were added later than the integer overloads. |
| 116 | +# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 1 |
| 117 | +# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT |
| 118 | + |
| 119 | +// This controls the availability of the C++20 synchronization library, |
| 120 | +// which requires shared library support for various operations |
| 121 | +// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>, |
| 122 | +// <semaphore>, and notification functions on std::atomic. |
| 123 | +# define _LIBCPP_AVAILABILITY_HAS_SYNC 1 |
| 124 | +# define _LIBCPP_AVAILABILITY_SYNC |
| 125 | + |
| 126 | +// This controls whether the library claims to provide a default verbose |
| 127 | +// termination function, and consequently whether the headers will try |
| 128 | +// to use it when the mechanism isn't overriden at compile-time. |
| 129 | +# define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 1 |
| 130 | +# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT |
| 131 | + |
| 132 | +// This controls the availability of the C++17 std::pmr library, |
| 133 | +// which is implemented in large part in the built library. |
| 134 | +# define _LIBCPP_AVAILABILITY_HAS_PMR 1 |
| 135 | +# define _LIBCPP_AVAILABILITY_PMR |
| 136 | + |
| 137 | +// This controls the availability of the C++20 time zone database. |
| 138 | +// The parser code is built in the library. |
| 139 | +# define _LIBCPP_AVAILABILITY_HAS_TZDB 1 |
| 140 | +# define _LIBCPP_AVAILABILITY_TZDB |
141 | 141 |
|
142 | 142 | // Enable additional explicit instantiations of iostreams components. This |
143 | 143 | // reduces the number of weak definitions generated in programs that use |
|
146 | 146 | // TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation, |
147 | 147 | // or once libc++ doesn't use the attribute anymore. |
148 | 148 | // TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed. |
149 | | -#if defined(_LIBCPP_COMPILER_GCC) || defined(_WIN32) |
150 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 |
151 | | -#endif |
| 149 | +# if !defined(_LIBCPP_COMPILER_GCC) && !defined(_WIN32) |
| 150 | +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 1 |
| 151 | +# else |
| 152 | +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0 |
| 153 | +# endif |
152 | 154 |
|
153 | 155 | #elif defined(__APPLE__) |
154 | 156 |
|
155 | | -# if (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) |
156 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS |
157 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS |
158 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST |
159 | | -# endif |
| 157 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS \ |
| 158 | + (!defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 50000) |
| 159 | + |
| 160 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS |
| 161 | +# define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS |
| 162 | + |
160 | 163 | # define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((availability(watchos,strict,introduced=5.0))) |
161 | 164 | # define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
162 | 165 | # define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
163 | 166 |
|
164 | | - // <filesystem> |
165 | | -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ |
166 | | - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
167 | | - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
168 | | - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) |
169 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY |
170 | | -# endif |
| 167 | +// <filesystem> |
| 168 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ |
| 169 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
| 170 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
| 171 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) |
| 172 | +# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 0 |
| 173 | +# else |
| 174 | +# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 1 |
| 175 | +# endif |
171 | 176 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY \ |
172 | 177 | __attribute__((availability(macos,strict,introduced=10.15))) \ |
173 | 178 | __attribute__((availability(ios,strict,introduced=13.0))) \ |
|
184 | 189 | _Pragma("clang attribute pop") \ |
185 | 190 | _Pragma("clang attribute pop") |
186 | 191 |
|
187 | | - // std::to_chars(floating-point) |
188 | | -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) || \ |
189 | | - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160300) || \ |
190 | | - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160300) || \ |
191 | | - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90300) |
192 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT |
193 | | -# endif |
| 192 | +// std::to_chars(floating-point) |
| 193 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) || \ |
| 194 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160300) || \ |
| 195 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160300) || \ |
| 196 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90300) |
| 197 | +# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 0 |
| 198 | +# else |
| 199 | +# define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT 1 |
| 200 | +# endif |
194 | 201 | # define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT \ |
195 | 202 | __attribute__((availability(macos,strict,introduced=13.3))) \ |
196 | 203 | __attribute__((availability(ios,strict,introduced=16.3))) \ |
197 | 204 | __attribute__((availability(tvos,strict,introduced=16.3))) \ |
198 | 205 | __attribute__((availability(watchos,strict,introduced=9.3))) |
199 | 206 |
|
200 | 207 | // c++20 synchronization library |
201 | | -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \ |
202 | | - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \ |
203 | | - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \ |
204 | | - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000) |
205 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_SYNC |
| 208 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \ |
| 209 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \ |
| 210 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \ |
| 211 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000) |
| 212 | +# define _LIBCPP_AVAILABILITY_HAS_SYNC 0 |
| 213 | +# else |
| 214 | +# define _LIBCPP_AVAILABILITY_HAS_SYNC 1 |
206 | 215 | # endif |
207 | 216 | # define _LIBCPP_AVAILABILITY_SYNC \ |
208 | 217 | __attribute__((availability(macos,strict,introduced=11.0))) \ |
209 | 218 | __attribute__((availability(ios,strict,introduced=14.0))) \ |
210 | 219 | __attribute__((availability(tvos,strict,introduced=14.0))) \ |
211 | 220 | __attribute__((availability(watchos,strict,introduced=7.0))) |
212 | 221 |
|
213 | | - // __libcpp_verbose_abort |
214 | | -# if 1 // TODO: Update once this is released |
215 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT |
216 | | -# endif |
| 222 | +// __libcpp_verbose_abort |
| 223 | +// TODO: Update once this is released |
| 224 | +# define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 0 |
| 225 | + |
217 | 226 | # define _LIBCPP_AVAILABILITY_VERBOSE_ABORT \ |
218 | 227 | __attribute__((unavailable)) |
219 | 228 |
|
220 | | - // std::pmr |
221 | | -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \ |
222 | | - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \ |
223 | | - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \ |
224 | | - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000) |
225 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_PMR |
226 | | -# endif |
| 229 | +// std::pmr |
| 230 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \ |
| 231 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \ |
| 232 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \ |
| 233 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000) |
| 234 | +# define _LIBCPP_AVAILABILITY_HAS_PMR 0 |
| 235 | +# else |
| 236 | +# define _LIBCPP_AVAILABILITY_HAS_PMR 1 |
| 237 | +# endif |
227 | 238 | // TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed |
228 | 239 | // Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support |
229 | 240 | // it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we |
|
238 | 249 | # define _LIBCPP_AVAILABILITY_PMR |
239 | 250 | # endif |
240 | 251 |
|
241 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_TZDB |
| 252 | +# define _LIBCPP_AVAILABILITY_HAS_TZDB 0 |
242 | 253 | # define _LIBCPP_AVAILABILITY_TZDB __attribute__((unavailable)) |
243 | 254 |
|
244 | 255 | # if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 120000) || \ |
245 | 256 | (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 150000) || \ |
246 | 257 | (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 150000) || \ |
247 | 258 | (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 80000) |
248 | | -# define _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 |
| 259 | +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0 |
| 260 | +# else |
| 261 | +# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 1 |
249 | 262 | # endif |
250 | 263 | #else |
251 | 264 |
|
|
0 commit comments