From f0a44b9e8b2b3b134b13259d39987c6d967ef8ef Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 23 Jun 2025 22:51:57 -0500 Subject: [PATCH] Gui: Selectively disable MSVC 4251 warning This warning is not relevant to our project in this instance. We are not concerned about ABI-compatibility of DLLs since they are all compiled at the same time when building FreeCAD. --- src/Gui/DocumentObserver.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index 38600565cf..df8bb9fec6 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -306,6 +306,11 @@ private: ViewProviderWeakPtrT ptr; }; +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4251) // MSVC emits warning C4251 too conservatively for our use-case +#endif + /** * The DocumentObserver class simplifies the step to write classes that listen * to what happens inside a document. @@ -368,6 +373,10 @@ private: Connection connectDocumentDelete; }; +#ifdef _MSC_VER +# pragma warning(pop) +#endif + } //namespace Gui #endif // GUI_DOCUMENTOBSERVER_H