mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
No anonymous structs to work around gcc 5 issue
This commit is contained in:
@@ -150,10 +150,8 @@
|
||||
#define MAKE_INIT_FN_(a, b) MAKE_INIT_FN__(a, b)
|
||||
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
||||
|
||||
void MAKE_INIT_FN(KernelImplementation_)(IfcGeom::impl::KernelFactoryImplementation* mapping) {
|
||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
||||
|
||||
struct {
|
||||
namespace {
|
||||
struct factory_t {
|
||||
IfcGeom::Kernel* operator()(IfcParse::IfcFile* file) const {
|
||||
IfcGeom::MAKE_TYPE_NAME(Kernel)* k = new IfcGeom::MAKE_TYPE_NAME(Kernel);
|
||||
if (file) {
|
||||
@@ -201,11 +199,14 @@ void MAKE_INIT_FN(KernelImplementation_)(IfcGeom::impl::KernelFactoryImplementat
|
||||
}
|
||||
return k;
|
||||
}
|
||||
} factory;
|
||||
|
||||
mapping->bind(schema_name, factory);
|
||||
};
|
||||
}
|
||||
|
||||
void MAKE_INIT_FN(KernelImplementation_)(IfcGeom::impl::KernelFactoryImplementation* mapping) {
|
||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
||||
factory_t factory;
|
||||
mapping->bind(schema_name, factory);
|
||||
}
|
||||
|
||||
#define Kernel MAKE_TYPE_NAME(Kernel)
|
||||
|
||||
|
||||
@@ -10,16 +10,19 @@ namespace IfcGeom {
|
||||
#define MAKE_INIT_FN_(a, b) MAKE_INIT_FN__(a, b)
|
||||
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
||||
|
||||
template <typename P>
|
||||
void MAKE_INIT_FN(IteratorImplementation_)(IteratorFactoryImplementation<P>* mapping) {
|
||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
||||
|
||||
struct {
|
||||
namespace {
|
||||
template <typename P>
|
||||
struct factory_t {
|
||||
IfcGeom::IteratorImplementation<P>* operator()(const IfcGeom::IteratorSettings& settings, IfcParse::IfcFile* file) const {
|
||||
return new IfcGeom::MAKE_TYPE_NAME(IteratorImplementation_)<P>(settings, file);
|
||||
}
|
||||
} factory;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void MAKE_INIT_FN(IteratorImplementation_)(IteratorFactoryImplementation<P>* mapping) {
|
||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
||||
factory_t<P> factory;
|
||||
mapping->bind(schema_name, factory);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user