From 22707fa534666812da985999b5e03ba92181f1e6 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 14 Jun 2026 21:02:35 +0200 Subject: [PATCH] Bring back multiple schema includes in IfcParseExamples.cpp --- src/examples/IfcParseExamples.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/examples/IfcParseExamples.cpp b/src/examples/IfcParseExamples.cpp index c4ae63b31d..2951285a60 100644 --- a/src/examples/IfcParseExamples.cpp +++ b/src/examples/IfcParseExamples.cpp @@ -25,8 +25,6 @@ #include "ifcparse/IfcFile.h" #include "ifcparse/IfcLogger.h" -#include INCLUDE_SCHEMA(ifcparse, IfcSchema) -#include INCLUDE_SCHEMA_DEFINITIONS(ifcparse, IfcSchema) #include #include @@ -43,6 +41,30 @@ static_assert(false, "A boost preprocessor sequence of schema identifiers is needed for this file to compile."); #endif +// A macro cannot expand to an include directive, so unroll enough includes for +// the maximum number of schemas supported by the build configuration. +#define INCLUDE_SCHEMA_N(n) \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_SEQ_SIZE(SCHEMA_SEQ), n), \ + BOOST_PP_STRINGIZE(ifcparse/BOOST_PP_CAT(Ifc, BOOST_PP_SEQ_ELEM(BOOST_PP_MIN(n, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_POP_BACK(SCHEMA_SEQ))), SCHEMA_SEQ)).h), \ + "ifcgeom/empty.h") + +#include INCLUDE_SCHEMA_N(0) +#include INCLUDE_SCHEMA_N(1) +#include INCLUDE_SCHEMA_N(2) +#include INCLUDE_SCHEMA_N(3) +#include INCLUDE_SCHEMA_N(4) +#include INCLUDE_SCHEMA_N(5) +#include INCLUDE_SCHEMA_N(6) +#include INCLUDE_SCHEMA_N(7) +#include INCLUDE_SCHEMA_N(8) +#include INCLUDE_SCHEMA_N(9) +#include INCLUDE_SCHEMA_N(10) +#include INCLUDE_SCHEMA_N(11) +#include INCLUDE_SCHEMA_N(12) +#include INCLUDE_SCHEMA_N(13) +#include INCLUDE_SCHEMA_N(14) +#include INCLUDE_SCHEMA_N(15) + #include #if USE_VLD