mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Fix Windows (MSVC) and WASM (Emscripten) build failures
Both surfaced on the first Windows/WASM CI run of this branch: - XmlSerializer.cpp: the IfcPropertySetDefinitionSet block used a C-style cast to convert the set to std::vector<IfcPropertySetDefinition>. GCC invokes the non-explicit conversion operator; MSVC rejects the cast to a template type (C2440/C3536/C2661). Use copy-initialisation instead, which invokes the same implicit conversion portably. (This block was dead until the SCHEMAS_->SCHEMA_HAS_ typo fix enabled it, so it had never hit MSVC.) - parse.cpp: the floating-point parse path falls back to strtod_l because libc++ =deletes the float from_chars overload. That fallback was guarded for __APPLE__ only; Emscripten uses the same libc++, so WASM hit the deleted from_chars. Extend the guard to __EMSCRIPTEN__ (its musl provides strtod_l/newlocale, treating all locales as C). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -300,7 +300,11 @@ ptree* descend(::logger& log, ifcopenshell::geometry::abstract_mapping* mapping,
|
||||
(log, object, &IfcSchema::IfcObject::IsDefinedBy, &IfcSchema::IfcRelDefinesByProperties::RelatingPropertyDefinition);
|
||||
|
||||
for (auto& s : property_set_sets) {
|
||||
auto set_sets_value = (decltype(property_sets))s;
|
||||
// Copy-initialise (not a C-style cast) so the implicit
|
||||
// IfcPropertySetDefinitionSet -> std::vector<IfcPropertySetDefinition>
|
||||
// conversion operator is used. MSVC rejects the equivalent cast to a
|
||||
// template type (C2440), whereas copy-initialisation is portable.
|
||||
decltype(property_sets) set_sets_value = s;
|
||||
property_sets.insert(property_sets.end(), set_sets_value.begin(), set_sets_value.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user