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
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,16 @@
89
89
# endif
90
90
#endif
91
91
92
+
// Exceptions can't be marked with __declspec(dllexport) in MinGW
93
+
#if !defined(PYBIND11_EXPORT)
94
+
# ifdef __MINGW32__
95
+
# definePYBIND11_EXPORT_EXCEPTION
96
+
# else
97
+
# definePYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
98
+
# endif
99
+
#endif
100
+
101
+
92
102
#if defined(_MSC_VER)
93
103
# definePYBIND11_NOINLINE__declspec(noinline)
94
104
#else
@@ -735,12 +745,6 @@ using expand_side_effects = bool[];
735
745
736
746
PYBIND11_NAMESPACE_END(detail)
737
747
738
-
#ifdef __MINGW32__
739
-
# pragma push_macro("PYBIND11_EXPORT")
740
-
# undef PYBIND11_EXPORT
741
-
# definePYBIND11_EXPORT
742
-
#endif
743
-
744
748
#if defined(_MSC_VER)
745
749
# pragma warning(push)
746
750
# 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.
@@ -757,7 +761,7 @@ class PYBIND11_EXPORT builtin_exception : public std::runtime_error {
757
761
#endif
758
762
759
763
#definePYBIND11_RUNTIME_EXCEPTION(name, type) \
760
-
classPYBIND11_EXPORT name : public builtin_exception { public: \
764
+
classPYBIND11_EXPORT_EXCEPTION name : 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.
0 commit comments