File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 164
164
# endif
165
165
#endif
166
166
167
- #if !defined(PYBIND11_EXPORT_EXCEPTION)
168
- # if defined(__apple_build_version__)
169
- # define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
170
- # else
171
- # define PYBIND11_EXPORT_EXCEPTION
172
- # endif
173
- #endif
174
-
175
167
// For CUDA, GCC7, GCC8:
176
168
// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`.
177
169
// When defining PYBIND11_NOINLINE_FORCED, it is best to also use `-Wno-attributes`.
@@ -329,6 +321,17 @@ PYBIND11_WARNING_POP
329
321
# endif
330
322
#endif
331
323
324
+ // For libc++, the exceptions should be exported,
325
+ // otherwise, the exception translation would be incorrect.
326
+ // IMPORTANT: This code block must stay BELOW the #include <exception> above (see PR #5390).
327
+ #if !defined(PYBIND11_EXPORT_EXCEPTION)
328
+ # if defined(_LIBCPP_EXCEPTION)
329
+ # define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
330
+ # else
331
+ # define PYBIND11_EXPORT_EXCEPTION
332
+ # endif
333
+ #endif
334
+
332
335
// Must be after including <version> or one of the other headers specified by the standard
333
336
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
334
337
# define PYBIND11_HAS_U8STRING
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def test_cross_module_exceptions(msg):
76
76
77
77
# TODO: FIXME
78
78
@pytest .mark .xfail (
79
- "env.MACOS and ( env.PYPY or pybind11_tests.compiler_info.startswith('Homebrew Clang')) or sys.platform.startswith('emscripten') " ,
79
+ "env.MACOS and env.PYPY" ,
80
80
raises = RuntimeError ,
81
81
reason = "See Issue #2847, PR #2999, PR #4324" ,
82
82
)
You can’t perform that action at this time.
0 commit comments