mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
Fix char8_t support (#4278)
Standard library macro __cpp_lib_char8_t is only available after including standard header
This commit is contained in:
parent
d1c31e9aa0
commit
07a61aa1c0
@ -205,10 +205,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
|
|
||||||
# define PYBIND11_HAS_U8STRING
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#if PY_VERSION_HEX < 0x03060000
|
#if PY_VERSION_HEX < 0x03060000
|
||||||
# error "PYTHON < 3.6 IS UNSUPPORTED. pybind11 v2.9 was the last to support Python 2 and 3.5."
|
# error "PYTHON < 3.6 IS UNSUPPORTED. pybind11 v2.9 was the last to support Python 2 and 3.5."
|
||||||
@ -259,6 +255,11 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Must be after including <version> or one of the other headers specified by the standard
|
||||||
|
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
|
||||||
|
# define PYBIND11_HAS_U8STRING
|
||||||
|
#endif
|
||||||
|
|
||||||
// #define PYBIND11_STR_LEGACY_PERMISSIVE
|
// #define PYBIND11_STR_LEGACY_PERMISSIVE
|
||||||
// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject
|
// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject
|
||||||
// (probably surprising and never documented, but this was the
|
// (probably surprising and never documented, but this was the
|
||||||
|
Loading…
Reference in New Issue
Block a user