mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-15 01:44:44 +00:00
Export libc++ exceptions (#5390)
* Export libc++ exceptions * Remove emscripten limit * Remove __apple_build_version__ condition from PYBIND11_EXPORT_EXCEPTION * Add a comment
This commit is contained in:
parent
f2907651fa
commit
077e49fcd6
@ -164,14 +164,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(PYBIND11_EXPORT_EXCEPTION)
|
|
||||||
# if defined(__apple_build_version__)
|
|
||||||
# define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
|
|
||||||
# else
|
|
||||||
# define PYBIND11_EXPORT_EXCEPTION
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For CUDA, GCC7, GCC8:
|
// For CUDA, GCC7, GCC8:
|
||||||
// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`.
|
// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`.
|
||||||
// When defining PYBIND11_NOINLINE_FORCED, it is best to also use `-Wno-attributes`.
|
// When defining PYBIND11_NOINLINE_FORCED, it is best to also use `-Wno-attributes`.
|
||||||
@ -329,6 +321,17 @@ PYBIND11_WARNING_POP
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For libc++, the exceptions should be exported,
|
||||||
|
// otherwise, the exception translation would be incorrect.
|
||||||
|
// IMPORTANT: This code block must stay BELOW the #include <exception> above (see PR #5390).
|
||||||
|
#if !defined(PYBIND11_EXPORT_EXCEPTION)
|
||||||
|
# if defined(_LIBCPP_EXCEPTION)
|
||||||
|
# define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
|
||||||
|
# else
|
||||||
|
# define PYBIND11_EXPORT_EXCEPTION
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Must be after including <version> or one of the other headers specified by the standard
|
// 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
|
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
|
||||||
# define PYBIND11_HAS_U8STRING
|
# define PYBIND11_HAS_U8STRING
|
||||||
|
@ -76,7 +76,7 @@ def test_cross_module_exceptions(msg):
|
|||||||
|
|
||||||
# TODO: FIXME
|
# TODO: FIXME
|
||||||
@pytest.mark.xfail(
|
@pytest.mark.xfail(
|
||||||
"env.MACOS and (env.PYPY or pybind11_tests.compiler_info.startswith('Homebrew Clang')) or sys.platform.startswith('emscripten')",
|
"env.MACOS and env.PYPY",
|
||||||
raises=RuntimeError,
|
raises=RuntimeError,
|
||||||
reason="See Issue #2847, PR #2999, PR #4324",
|
reason="See Issue #2847, PR #2999, PR #4324",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user