You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/pybind11/detail/common.h
+9-2
Original file line number
Diff line number
Diff line change
@@ -723,16 +723,23 @@ using expand_side_effects = bool[];
723
723
724
724
PYBIND11_NAMESPACE_END(detail)
725
725
726
+
#if defined(_MSC_VER)
727
+
# pragma warning(push)
728
+
# pragma warning(disable: 4275) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class.
729
+
#endif
726
730
/// C++ bindings of builtin Python exceptions
727
-
class builtin_exception : public std::runtime_error {
731
+
classPYBIND11_EXPORTbuiltin_exception : public std::runtime_error {
728
732
public:
729
733
using std::runtime_error::runtime_error;
730
734
/// Set the error using the Python C API
731
735
virtualvoidset_error() const = 0;
732
736
};
737
+
#if defined(_MSC_VER)
738
+
# pragma warning(pop)
739
+
#endif
733
740
734
741
#definePYBIND11_RUNTIME_EXCEPTION(name, type) \
735
-
classname : publicbuiltin_exception { public: \
742
+
classPYBIND11_EXPORTname : public builtin_exception { public: \
# pragma warning(disable: 4275 4251) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class.
325
+
#endif
322
326
/// Fetch and hold an error which was already set in Python. An instance of this is typically
323
327
/// thrown to propagate python-side errors back through C++ which can either be caught manually or
324
328
/// else falls back to the function dispatcher (which then raises the captured error back to
325
329
/// python).
326
-
class error_already_set : public std::runtime_error {
330
+
classPYBIND11_EXPORTerror_already_set : public std::runtime_error {
327
331
public:
328
332
/// Constructs a new exception from the current Python error indicator, if any. The current
329
333
/// Python error indicator will be cleared.
@@ -371,6 +375,9 @@ class error_already_set : public std::runtime_error {
371
375
private:
372
376
object m_type, m_value, m_trace;
373
377
};
378
+
#if defined(_MSC_VER)
379
+
# pragma warning(pop)
380
+
#endif
374
381
375
382
/** \defgroup python_builtins _
376
383
Unless stated otherwise, the following C++ functions behave the same
0 commit comments