mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix warning C4275
It's not enough to disable this warning by adding /wd4257 at build time because it's triggered when the library is consumed.
This commit is contained in:
@@ -151,11 +151,6 @@ if(MSVC AND MSVC_PARALLEL_BUILD)
|
|||||||
add_definitions("/MP")
|
add_definitions("/MP")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC AND BUILD_SHARED_LIBS)
|
|
||||||
# @todo how do projects normally deal with this regarding classes derived from std::exception?
|
|
||||||
add_compile_options(/wd4275)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NO_WARN)
|
if(NO_WARN)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_compile_options("/w")
|
add_compile_options("/w")
|
||||||
|
|||||||
@@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
using namespace ifcopenshell::geometry;
|
using namespace ifcopenshell::geometry;
|
||||||
|
|
||||||
|
const char* ifcopenshell::not_implemented_error::what() const noexcept {
|
||||||
|
return "Not implemented.";
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* ifcopenshell::not_supported_error::what() const noexcept {
|
||||||
|
return "Not supported.";
|
||||||
|
}
|
||||||
|
|
||||||
bool ifcopenshell::geometry::kernels::AbstractKernel::convert(const taxonomy::ptr item, IfcGeom::ConversionResults& results) {
|
bool ifcopenshell::geometry::kernels::AbstractKernel::convert(const taxonomy::ptr item, IfcGeom::ConversionResults& results) {
|
||||||
if (settings_.get<settings::CacheShapes>().get()) {
|
if (settings_.get<settings::CacheShapes>().get()) {
|
||||||
auto it = cache_.find(item);
|
auto it = cache_.find(item);
|
||||||
|
|||||||
@@ -37,20 +37,25 @@ inline static bool ALMOST_THE_SAME(const T& a, const T& b, double tolerance = AL
|
|||||||
|
|
||||||
namespace ifcopenshell {
|
namespace ifcopenshell {
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4275)
|
||||||
|
#endif
|
||||||
|
|
||||||
class IFC_GEOM_API not_implemented_error : public std::exception {
|
class IFC_GEOM_API not_implemented_error : public std::exception {
|
||||||
public:
|
public:
|
||||||
const char* what() const noexcept override {
|
const char* what() const noexcept override;
|
||||||
return "Not implemented.";
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class IFC_GEOM_API not_supported_error : public std::exception {
|
class IFC_GEOM_API not_supported_error : public std::exception {
|
||||||
public:
|
public:
|
||||||
const char* what() const noexcept override {
|
const char* what() const noexcept override;
|
||||||
return "Not supported.";
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace geometry { namespace kernels {
|
namespace geometry { namespace kernels {
|
||||||
|
|
||||||
class IFC_GEOM_API AbstractKernel {
|
class IFC_GEOM_API AbstractKernel {
|
||||||
|
|||||||
@@ -94,3 +94,7 @@ std::istream& ifcopenshell::geometry::settings::operator>>(std::istream& in, Tri
|
|||||||
}
|
}
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IfcGeom::geometry_exception::~geometry_exception() = default;
|
||||||
|
|
||||||
|
IfcGeom::too_many_faces_exception::~too_many_faces_exception() = default;
|
||||||
|
|||||||
@@ -655,6 +655,12 @@ namespace ifcopenshell {
|
|||||||
|
|
||||||
// @todo find a place
|
// @todo find a place
|
||||||
namespace IfcGeom {
|
namespace IfcGeom {
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4275)
|
||||||
|
#endif
|
||||||
|
|
||||||
class IFC_GEOM_API geometry_exception : public std::runtime_error {
|
class IFC_GEOM_API geometry_exception : public std::runtime_error {
|
||||||
protected:
|
protected:
|
||||||
std::string message;
|
std::string message;
|
||||||
@@ -662,12 +668,19 @@ namespace IfcGeom {
|
|||||||
geometry_exception(const std::string& m)
|
geometry_exception(const std::string& m)
|
||||||
: std::runtime_error(m)
|
: std::runtime_error(m)
|
||||||
{}
|
{}
|
||||||
|
~geometry_exception() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IFC_GEOM_API too_many_faces_exception : public geometry_exception {
|
class IFC_GEOM_API too_many_faces_exception : public geometry_exception {
|
||||||
public:
|
public:
|
||||||
too_many_faces_exception()
|
too_many_faces_exception()
|
||||||
: geometry_exception("Too many faces for operation") {}
|
: geometry_exception("Too many faces for operation") {}
|
||||||
|
~too_many_faces_exception() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -223,6 +223,8 @@ namespace {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ifcopenshell::geometry::taxonomy::topology_error::~topology_error() = default;
|
||||||
|
|
||||||
bool ifcopenshell::geometry::taxonomy::less(item::const_ptr a, item::const_ptr b) {
|
bool ifcopenshell::geometry::taxonomy::less(item::const_ptr a, item::const_ptr b) {
|
||||||
if (a == b) {
|
if (a == b) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -85,14 +85,24 @@ typedef std::uniqe_ptr<const item> ptr;
|
|||||||
#define DECLARE_PTR(item) \
|
#define DECLARE_PTR(item) \
|
||||||
typedef item* ptr; \
|
typedef item* ptr; \
|
||||||
typedef item const* ptr;
|
typedef item const* ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4275)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class IFC_GEOM_API topology_error : public std::runtime_error {
|
class IFC_GEOM_API topology_error : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
topology_error() : std::runtime_error("Generic topology error") {}
|
topology_error() : std::runtime_error("Generic topology error") {}
|
||||||
topology_error(const char* const s) : std::runtime_error(s) {}
|
topology_error(const char* const s) : std::runtime_error(s) {}
|
||||||
|
~topology_error() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Implementer note: If you add a new item type, be sure to do the following
|
// Implementer note: If you add a new item type, be sure to do the following
|
||||||
// 1) Add a new kind to this list
|
// 1) Add a new kind to this list
|
||||||
// 2) Update the values array used by kind_to_string()
|
// 2) Update the values array used by kind_to_string()
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#include "IfcException.h"
|
||||||
|
|
||||||
|
IfcParse::IfcException::~IfcException() = default;
|
||||||
|
|
||||||
|
IfcParse::IfcAttributeOutOfRangeException::~IfcAttributeOutOfRangeException() = default;
|
||||||
|
|
||||||
|
IfcParse::IfcInvalidTokenException::~IfcInvalidTokenException() = default;
|
||||||
@@ -41,8 +41,8 @@ class IFC_PARSE_API IfcException : public std::exception {
|
|||||||
public:
|
public:
|
||||||
IfcException(const std::string& message)
|
IfcException(const std::string& message)
|
||||||
: message_(message) {}
|
: message_(message) {}
|
||||||
virtual ~IfcException() throw() {}
|
~IfcException() override;
|
||||||
virtual const char* what() const throw() {
|
const char* what() const noexcept override {
|
||||||
return message_.c_str();
|
return message_.c_str();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -51,7 +51,7 @@ class IFC_PARSE_API IfcAttributeOutOfRangeException : public IfcException {
|
|||||||
public:
|
public:
|
||||||
IfcAttributeOutOfRangeException(const std::string& exception)
|
IfcAttributeOutOfRangeException(const std::string& exception)
|
||||||
: IfcException(exception) {}
|
: IfcException(exception) {}
|
||||||
~IfcAttributeOutOfRangeException() throw() {}
|
~IfcAttributeOutOfRangeException() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
|
class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
|
||||||
@@ -70,7 +70,7 @@ class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
|
|||||||
: IfcException(
|
: IfcException(
|
||||||
std::string("Unexpected '") + std::string(1, character) + "' at offset " +
|
std::string("Unexpected '") + std::string(1, character) + "' at offset " +
|
||||||
boost::lexical_cast<std::string>(token_start)) {}
|
boost::lexical_cast<std::string>(token_start)) {}
|
||||||
~IfcInvalidTokenException() throw() {}
|
~IfcInvalidTokenException() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IfcParse
|
} // namespace IfcParse
|
||||||
|
|||||||
Reference in New Issue
Block a user