From 77b72a9dde5bb517e582c0d127a793be979d35a7 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Tue, 31 May 2016 14:45:22 +0300 Subject: [PATCH] IfcException.h: suppress C4275 warnings --- cmake/CMakeLists.txt | 3 ++- src/ifcparse/IfcException.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index bcc722abb7..37dc12356c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -66,7 +66,8 @@ if (BUILD_SHARED_LIBS) add_definitions(-DBUILD_SHARED_LIBS) if (MSVC) message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.") - # There will be couple hundreds of these so suppress them away. + # C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' + # There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx add_definitions(-wd4251) endif() set(IFCDIRS "${LIBDIR}") diff --git a/src/ifcparse/IfcException.h b/src/ifcparse/IfcException.h index 9033c24187..0eaaecf1f0 100644 --- a/src/ifcparse/IfcException.h +++ b/src/ifcparse/IfcException.h @@ -25,6 +25,13 @@ #include #include +#ifdef _MSC_VER +// "C4275 can be ignored in Visual C++ if you are deriving from a type in the Standard C++ Library", +// https://msdn.microsoft.com/en-us/library/3tdb471s.aspx +#pragma warning(push) +#pragma warning(disable : 4275) +#endif + namespace IfcParse { class IfcParse_EXPORT IfcException : public std::exception { private: @@ -38,7 +45,7 @@ namespace IfcParse { } }; - class IfcAttributeOutOfRangeException : public IfcException { + class IfcParse_EXPORT IfcAttributeOutOfRangeException : public IfcException { public: IfcAttributeOutOfRangeException(const std::string& e) : IfcException(e) {} @@ -46,4 +53,8 @@ namespace IfcParse { }; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #endif