|
50 | 50 | # endif
|
51 | 51 | #endif
|
52 | 52 |
|
| 53 | +// These PYBIND11_HAS_... macros are consolidated in pybind11/detail/common.h |
| 54 | +// to simplify backward compatibility handling for users (e.g., via #ifdef checks): |
| 55 | +#define PYBIND11_HAS_TYPE_CASTER_STD_FUNCTION_SPECIALIZATIONS 1 |
| 56 | +#define PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT 1 |
| 57 | +#define PYBIND11_HAS_CPP_CONDUIT 1 |
| 58 | +#define PYBIND11_HAS_NATIVE_ENUM 1 |
| 59 | + |
| 60 | +#if defined(PYBIND11_CPP17) && defined(__has_include) |
| 61 | +# if __has_include(<filesystem>) |
| 62 | +# define PYBIND11_HAS_FILESYSTEM 1 |
| 63 | +# elif __has_include(<experimental/filesystem>) |
| 64 | +# define PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM 1 |
| 65 | +# endif |
| 66 | +#endif |
| 67 | + |
53 | 68 | #if defined(__cpp_lib_launder) && !(defined(_MSC_VER) && (_MSC_VER < 1914))
|
54 | 69 | # define PYBIND11_STD_LAUNDER std::launder
|
55 | 70 | # define PYBIND11_HAS_STD_LAUNDER 1
|
|
168 | 183 | # define PYBIND11_HAS_VARIANT 1
|
169 | 184 | #endif
|
170 | 185 |
|
171 |
| -#if defined(PYBIND11_CPP17) |
172 |
| -# if defined(__has_include) |
173 |
| -# if __has_include(<string_view>) |
174 |
| -# define PYBIND11_HAS_STRING_VIEW |
175 |
| -# endif |
176 |
| -# elif defined(_MSC_VER) |
177 |
| -# define PYBIND11_HAS_STRING_VIEW |
178 |
| -# endif |
| 186 | +#if defined(PYBIND11_CPP17) \ |
| 187 | + && ((defined(__has_include) && __has_include(<string_view>)) || defined(_MSC_VER)) |
| 188 | +# define PYBIND11_HAS_STRING_VIEW 1 |
179 | 189 | #endif
|
180 | 190 |
|
181 | 191 | #if (defined(PYPY_VERSION) || defined(GRAALVM_PYTHON)) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
|
|
213 | 223 |
|
214 | 224 | // Must be after including <version> or one of the other headers specified by the standard
|
215 | 225 | #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
|
216 |
| -# define PYBIND11_HAS_U8STRING |
| 226 | +# define PYBIND11_HAS_U8STRING 1 |
217 | 227 | #endif
|
218 | 228 |
|
219 | 229 | // See description of PR #4246:
|
|
0 commit comments