|
43 | 43 | // as unavailable. When vendors decide to ship the feature as part of their
|
44 | 44 | // shared library, they can update the markup appropriately.
|
45 | 45 | //
|
| 46 | +// Furthermore, many features in the standard library have corresponding |
| 47 | +// feature-test macros. When a feature is made unavailable on some deployment |
| 48 | +// target, a macro should be defined to signal that it is unavailable. That |
| 49 | +// macro can then be picked up when feature-test macros are generated (see |
| 50 | +// generate_feature_test_macro_components.py) to make sure that feature-test |
| 51 | +// macros don't announce a feature as being implemented if it has been marked |
| 52 | +// as unavailable. |
| 53 | +// |
46 | 54 | // Note that this mechanism is disabled by default in the "upstream" libc++.
|
47 | 55 | // Availability annotations are only meaningful when shipping libc++ inside
|
48 | 56 | // a platform (i.e. as a system library), and so vendors that want them should
|
|
76 | 84 | // This controls the availability of std::shared_mutex and std::shared_timed_mutex,
|
77 | 85 | // which were added to the dylib later.
|
78 | 86 | # define _LIBCPP_AVAILABILITY_SHARED_MUTEX
|
| 87 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex |
| 88 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex |
79 | 89 |
|
80 | 90 | // These macros control the availability of std::bad_optional_access and
|
81 | 91 | // other exception types. These were put in the shared library to prevent
|
|
114 | 124 | # define _LIBCPP_AVAILABILITY_FILESYSTEM
|
115 | 125 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
|
116 | 126 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
|
| 127 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem |
117 | 128 |
|
118 | 129 | // This controls the availability of std::to_chars.
|
119 | 130 | # define _LIBCPP_AVAILABILITY_TO_CHARS
|
|
122 | 133 | // which requires shared library support for various operations
|
123 | 134 | // (see libcxx/src/atomic.cpp).
|
124 | 135 | # define _LIBCPP_AVAILABILITY_SYNC
|
| 136 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait |
| 137 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier |
| 138 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch |
| 139 | +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore |
125 | 140 |
|
126 | 141 | #elif defined(__APPLE__)
|
127 | 142 |
|
|
130 | 145 | __attribute__((availability(ios,strict,introduced=10.0))) \
|
131 | 146 | __attribute__((availability(tvos,strict,introduced=10.0))) \
|
132 | 147 | __attribute__((availability(watchos,strict,introduced=3.0)))
|
| 148 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \ |
| 149 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
| 150 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \ |
| 151 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000) |
| 152 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex |
| 153 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex |
| 154 | +# endif |
| 155 | + |
133 | 156 | # define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
|
134 | 157 | __attribute__((availability(macosx,strict,introduced=10.13))) \
|
135 | 158 | __attribute__((availability(ios,strict,introduced=11.0))) \
|
|
139 | 162 | _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
140 | 163 | # define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
|
141 | 164 | _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
| 165 | + |
142 | 166 | # define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
|
143 | 167 | __attribute__((availability(macosx,strict,introduced=10.12))) \
|
144 | 168 | __attribute__((availability(ios,strict,introduced=10.0))) \
|
145 | 169 | __attribute__((availability(tvos,strict,introduced=10.0))) \
|
146 | 170 | __attribute__((availability(watchos,strict,introduced=3.0)))
|
| 171 | + |
147 | 172 | # define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
|
148 | 173 | __attribute__((availability(macosx,strict,introduced=10.12))) \
|
149 | 174 | __attribute__((availability(ios,strict,introduced=10.0))) \
|
150 | 175 | __attribute__((availability(tvos,strict,introduced=10.0))) \
|
151 | 176 | __attribute__((availability(watchos,strict,introduced=3.0)))
|
| 177 | + |
152 | 178 | # define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
|
153 | 179 | __attribute__((availability(ios,strict,introduced=6.0)))
|
| 180 | + |
154 | 181 | # define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
|
155 | 182 | __attribute__((availability(macosx,strict,introduced=10.9))) \
|
156 | 183 | __attribute__((availability(ios,strict,introduced=7.0)))
|
| 184 | + |
157 | 185 | # define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
|
158 | 186 | __attribute__((availability(macosx,strict,introduced=10.9))) \
|
159 | 187 | __attribute__((availability(ios,strict,introduced=7.0)))
|
| 188 | + |
160 | 189 | # define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
|
161 | 190 | __attribute__((availability(macosx,strict,introduced=10.9))) \
|
162 | 191 | __attribute__((availability(ios,strict,introduced=7.0)))
|
| 192 | + |
163 | 193 | # define _LIBCPP_AVAILABILITY_FILESYSTEM \
|
164 | 194 | __attribute__((availability(macosx,strict,introduced=10.15))) \
|
165 | 195 | __attribute__((availability(ios,strict,introduced=13.0))) \
|
|
175 | 205 | _Pragma("clang attribute pop") \
|
176 | 206 | _Pragma("clang attribute pop") \
|
177 | 207 | _Pragma("clang attribute pop")
|
| 208 | +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ |
| 209 | + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
| 210 | + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ |
| 211 | + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) |
| 212 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem |
| 213 | +# endif |
| 214 | + |
178 | 215 | # define _LIBCPP_AVAILABILITY_TO_CHARS \
|
179 | 216 | _LIBCPP_AVAILABILITY_FILESYSTEM
|
| 217 | + |
| 218 | + // Note: Those are not ABI-stable yet, so we can't ship them. |
180 | 219 | # define _LIBCPP_AVAILABILITY_SYNC \
|
181 | 220 | __attribute__((unavailable))
|
| 221 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait |
| 222 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier |
| 223 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch |
| 224 | +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore |
182 | 225 |
|
183 | 226 | #else
|
184 | 227 |
|
|
0 commit comments