|
87 | 87 |
|
88 | 88 | #if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
|
89 | 89 |
|
90 |
| - // This controls the availability of std::shared_mutex and std::shared_timed_mutex, |
91 |
| - // which were added to the dylib later. |
92 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX |
93 |
| -# define _LIBCPP_AVAILABILITY_SHARED_MUTEX |
94 |
| - |
95 | 90 | // These macros control the availability of std::bad_optional_access and
|
96 | 91 | // other exception types. These were put in the shared library to prevent
|
97 | 92 | // code bloat from every user program defining the vtable for these exception
|
|
109 | 104 | // # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
|
110 | 105 | # define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
|
111 | 106 |
|
112 |
| - // This controls the availability of std::uncaught_exceptions(). |
113 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS |
114 |
| -# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS |
115 |
| - |
116 |
| - // This controls the availability of the sized version of ::operator delete, |
117 |
| - // ::operator delete[], and their align_val_t variants, which were all added |
118 |
| - // in C++17, and hence not present in early dylibs. |
119 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE |
120 |
| -# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE |
121 |
| - |
122 |
| - // This controls the availability of the std::future_error exception. |
123 |
| - // |
124 |
| - // Note that when exceptions are disabled, the methods that normally throw |
125 |
| - // std::future_error can be used even on older deployment targets, but those |
126 |
| - // methods will abort instead of throwing. |
127 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR |
128 |
| -# define _LIBCPP_AVAILABILITY_FUTURE_ERROR |
129 |
| - |
130 |
| - // This controls the availability of std::type_info's vtable. |
131 |
| - // I can't imagine how using std::type_info can work at all if |
132 |
| - // this isn't supported. |
133 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE |
134 |
| -# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE |
135 |
| - |
136 |
| - // This controls the availability of std::locale::category members |
137 |
| - // (e.g. std::locale::collate), which are defined in the dylib. |
138 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY |
139 |
| -# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY |
140 |
| - |
141 |
| - // This controls the availability of atomic operations on std::shared_ptr |
142 |
| - // (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared |
143 |
| - // lock table located in the dylib. |
144 |
| -// # define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR |
145 |
| -# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR |
146 |
| - |
147 | 107 | // These macros control the availability of all parts of <filesystem> that
|
148 | 108 | // depend on something in the dylib.
|
149 | 109 | // # define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY
|
|
192 | 152 |
|
193 | 153 | #elif defined(__APPLE__)
|
194 | 154 |
|
195 |
| - // shared_mutex and shared_timed_mutex |
196 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \ |
197 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
198 |
| - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
199 |
| - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000) |
200 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX |
201 |
| -# endif |
202 |
| -# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \ |
203 |
| - __attribute__((availability(macos,strict,introduced=10.12))) \ |
204 |
| - __attribute__((availability(ios,strict,introduced=10.0))) \ |
205 |
| - __attribute__((availability(tvos,strict,introduced=10.0))) \ |
206 |
| - __attribute__((availability(watchos,strict,introduced=3.0))) |
207 |
| - |
208 |
| - // bad_optional_access, bad_variant_access and bad_any_cast |
209 |
| - // Note: bad_optional_access & friends were not introduced in the matching |
210 |
| - // macOS and iOS versions, so the version mismatch between macOS and others |
211 |
| - // is intended. |
212 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \ |
213 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \ |
214 |
| - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000) || \ |
215 |
| - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) |
216 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS |
217 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS |
218 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST |
219 |
| -# endif |
220 |
| -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \ |
221 |
| - __attribute__((availability(macos,strict,introduced=10.13))) \ |
222 |
| - __attribute__((availability(ios,strict,introduced=12.0))) \ |
223 |
| - __attribute__((availability(tvos,strict,introduced=12.0))) \ |
224 |
| - __attribute__((availability(watchos,strict,introduced=5.0))) |
225 |
| -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \ |
226 |
| - _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
227 |
| -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \ |
228 |
| - _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
229 |
| - |
230 |
| - // uncaught_exceptions |
231 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \ |
232 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
233 |
| - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
234 |
| - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000) |
235 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS |
236 |
| -# endif |
237 |
| -# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \ |
238 |
| - __attribute__((availability(macos,strict,introduced=10.12))) \ |
239 |
| - __attribute__((availability(ios,strict,introduced=10.0))) \ |
240 |
| - __attribute__((availability(tvos,strict,introduced=10.0))) \ |
241 |
| - __attribute__((availability(watchos,strict,introduced=3.0))) |
242 |
| - |
243 |
| - // sized operator new and sized operator delete |
244 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \ |
245 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
246 |
| - (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
247 |
| - (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000) |
248 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE |
249 |
| -# endif |
250 |
| -# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \ |
251 |
| - __attribute__((availability(macos,strict,introduced=10.12))) \ |
252 |
| - __attribute__((availability(ios,strict,introduced=10.0))) \ |
253 |
| - __attribute__((availability(tvos,strict,introduced=10.0))) \ |
254 |
| - __attribute__((availability(watchos,strict,introduced=3.0))) |
255 |
| - |
256 |
| - // future_error |
257 |
| -# if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 60000) |
258 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR |
259 |
| -# endif |
260 |
| -# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \ |
261 |
| - __attribute__((availability(ios,strict,introduced=6.0))) |
262 |
| - |
263 |
| - // type_info's vtable |
264 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \ |
265 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000) |
266 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE |
267 |
| -# endif |
268 |
| -# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \ |
269 |
| - __attribute__((availability(macos,strict,introduced=10.9))) \ |
270 |
| - __attribute__((availability(ios,strict,introduced=7.0))) |
271 |
| - |
272 |
| - // locale::category |
273 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \ |
274 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000) |
275 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY |
276 |
| -# endif |
277 |
| -# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \ |
278 |
| - __attribute__((availability(macos,strict,introduced=10.9))) \ |
279 |
| - __attribute__((availability(ios,strict,introduced=7.0))) |
280 |
| - |
281 |
| - // atomic operations on shared_ptr |
282 |
| -# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \ |
283 |
| - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000) |
284 |
| -# define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR |
285 |
| -# endif |
286 |
| -# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \ |
287 |
| - __attribute__((availability(macos,strict,introduced=10.9))) \ |
288 |
| - __attribute__((availability(ios,strict,introduced=7.0))) |
| 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 |
| 160 | +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((availability(watchos,strict,introduced=5.0))) |
| 161 | +# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
| 162 | +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS |
289 | 163 |
|
290 | 164 | // <filesystem>
|
291 | 165 | # if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
|
|
385 | 259 | // Those are defined in terms of the availability attributes above, and
|
386 | 260 | // should not be vendor-specific.
|
387 | 261 | #if defined(_LIBCPP_HAS_NO_EXCEPTIONS)
|
388 |
| -# define _LIBCPP_AVAILABILITY_FUTURE |
389 | 262 | # define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
390 | 263 | # define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
|
391 | 264 | # define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
|
392 | 265 | #else
|
393 |
| -# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR |
394 | 266 | # define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST
|
395 | 267 | # define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
396 | 268 | # define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
|
|
0 commit comments