Respect tokens in macro string concatenation

This commit is contained in:
Thomas Krijnen
2022-07-18 09:23:59 +02:00
parent 2e76a800f5
commit 205ff0914c
4 changed files with 8 additions and 8 deletions
@@ -8,13 +8,13 @@
// - extern void init_IteratorImplementation_Ifc2x3(IteratorFactoryImplementation*);
// - ...
#define EXTERNAL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(extern void init_IteratorImplementation_, elem), (IteratorFactoryImplementation*);)
extern void BOOST_PP_CAT(init_IteratorImplementation_, elem)(IteratorFactoryImplementation*);
// Declares the schema-based external iterator initialization routines:
// - init_IteratorImplementation_Ifc2x3(this);
// - ...
#define CALL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(init_IteratorImplementation_, elem), (this);)
BOOST_PP_CAT(init_IteratorImplementation_, elem)(this);
IFC_GEOM_API IteratorFactoryImplementation& iterator_implementations() {
static IteratorFactoryImplementation impl;
+2 -2
View File
@@ -55,13 +55,13 @@ IfcGeom::impl::KernelFactoryImplementation& IfcGeom::impl::kernel_implementation
// - extern void init_KernelImplementation_Ifc2x3(IfcGeom::impl::KernelFactoryImplementation*);
// - ...
#define EXTERNAL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(extern void init_KernelImplementation_, elem), (IfcGeom::impl::KernelFactoryImplementation*);)
extern void BOOST_PP_CAT(init_KernelImplementation_, elem)(IfcGeom::impl::KernelFactoryImplementation*);
// Declares the schema-based external iterator initialization routines:
// - init_IteratorImplementation_Ifc2x3(this);
// - ...
#define CALL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(init_KernelImplementation_, elem), (this);)
BOOST_PP_CAT(init_KernelImplementation_, elem)(this);
BOOST_PP_SEQ_FOR_EACH(EXTERNAL_DEFS, , SCHEMA_SEQ)
@@ -7,10 +7,10 @@
#include <boost/algorithm/string/case_conv.hpp>
#define EXTERNAL_DEFS_1(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(IfcUtil::IfcBaseClass* tesselate_, elem), (const TopoDS_Shape& shape, double deflection);)
IfcUtil::IfcBaseClass* BOOST_PP_CAT(tesselate_, elem)(const TopoDS_Shape& shape, double deflection);
#define EXTERNAL_DEFS_2(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(IfcUtil::IfcBaseClass* serialise_, elem), (const TopoDS_Shape& shape, bool advanced);)
IfcUtil::IfcBaseClass* BOOST_PP_CAT(serialise_, elem)(const TopoDS_Shape& shape, bool advanced);
#define CONDITIONAL_CALL(r, data, elem) \
if (schema_name_lower == BOOST_PP_STRINGIZE(BOOST_PP_CAT(elem,))) { \
+2 -2
View File
@@ -5,10 +5,10 @@
#include <boost/algorithm/string/case_conv.hpp>
#define EXTERNAL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(extern void init_XmlSerializer, elem), (XmlSerializerFactory::Factory*);)
extern void BOOST_PP_CAT(init_XmlSerializer, elem)(XmlSerializerFactory::Factory*);
#define CALL_DEFS(r, data, elem) \
BOOST_PP_CAT(BOOST_PP_CAT(init_XmlSerializer, elem), (this);)
BOOST_PP_CAT(init_XmlSerializer, elem)(this);
BOOST_PP_SEQ_FOR_EACH(EXTERNAL_DEFS, , SCHEMA_SEQ)