Skip to content

Commit

Permalink
Fix char8_t support (#4278)
Browse files Browse the repository at this point in the history
Standard library macro __cpp_lib_char8_t is only available
after including standard header
  • Loading branch information
VemundH authored Oct 23, 2022
1 parent d1c31e9 commit 07a61aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@
# endif
#endif

#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
# define PYBIND11_HAS_U8STRING
#endif

#include <Python.h>
#if PY_VERSION_HEX < 0x03060000
# error "PYTHON < 3.6 IS UNSUPPORTED. pybind11 v2.9 was the last to support Python 2 and 3.5."
Expand Down Expand Up @@ -259,6 +255,11 @@
# 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
// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject
// (probably surprising and never documented, but this was the
Expand Down

0 comments on commit 07a61aa

Please sign in to comment.