Skip to content

Commit fd9ba0d

Browse files
committed
char wchar_t compatibility
1 parent 9a9422b commit fd9ba0d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/ifcconvert/IfcConvert.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,18 @@ int main(int argc, char** argv) {
575575
// These serializers do not support opening unicode paths. Therefore
576576
// a random temp file is generated using only ASCII characters instead.
577577
std::random_device rng;
578-
std::uniform_int_distribution<int> index_dist(L'A', L'Z');
579-
output_temp_filename = L".ifcopenshell.";
578+
std::uniform_int_distribution<int> index_dist('A', 'Z');
579+
{
580+
std::string v = ".ifcopenshell.";
581+
output_temp_filename += path_t(v.begin(), v.end());
582+
}
580583
for (int i = 0; i < 8; ++i) {
581-
output_temp_filename.push_back(static_cast<wchar_t>(index_dist(rng)));
584+
output_temp_filename.push_back(static_cast<path_t::value_type>(index_dist(rng)));
585+
}
586+
{
587+
std::string v = ".tmp.";
588+
output_temp_filename += path_t(v.begin(), v.end());
582589
}
583-
output_temp_filename += L".tmp";
584590
}
585591

586592
SerializerSettings settings;

0 commit comments

Comments
 (0)