mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +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_(a, b) MAKE_INIT_FN__(a, b)
|
||||||
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
||||||
|
|
||||||
void MAKE_INIT_FN(KernelImplementation_)(IfcGeom::impl::KernelFactoryImplementation* mapping) {
|
namespace {
|
||||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
struct factory_t {
|
||||||
|
|
||||||
struct {
|
|
||||||
IfcGeom::Kernel* operator()(IfcParse::IfcFile* file) const {
|
IfcGeom::Kernel* operator()(IfcParse::IfcFile* file) const {
|
||||||
IfcGeom::MAKE_TYPE_NAME(Kernel)* k = new IfcGeom::MAKE_TYPE_NAME(Kernel);
|
IfcGeom::MAKE_TYPE_NAME(Kernel)* k = new IfcGeom::MAKE_TYPE_NAME(Kernel);
|
||||||
if (file) {
|
if (file) {
|
||||||
@@ -201,11 +199,14 @@ void MAKE_INIT_FN(KernelImplementation_)(IfcGeom::impl::KernelFactoryImplementat
|
|||||||
}
|
}
|
||||||
return k;
|
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)
|
#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_(a, b) MAKE_INIT_FN__(a, b)
|
||||||
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
|
||||||
|
|
||||||
template <typename P>
|
namespace {
|
||||||
void MAKE_INIT_FN(IteratorImplementation_)(IteratorFactoryImplementation<P>* mapping) {
|
template <typename P>
|
||||||
static const std::string schema_name = STRINGIFY(IfcSchema);
|
struct factory_t {
|
||||||
|
|
||||||
struct {
|
|
||||||
IfcGeom::IteratorImplementation<P>* operator()(const IfcGeom::IteratorSettings& settings, IfcParse::IfcFile* file) const {
|
IfcGeom::IteratorImplementation<P>* operator()(const IfcGeom::IteratorSettings& settings, IfcParse::IfcFile* file) const {
|
||||||
return new IfcGeom::MAKE_TYPE_NAME(IteratorImplementation_)<P>(settings, file);
|
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);
|
mapping->bind(schema_name, factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user