Skip to content

Commit

Permalink
fix: localeconv() on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 20, 2023
1 parent 66a6f18 commit 18a338b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lanelet2_io/src/OsmHandlerLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ void registerIds(const MapT& map) {
}

void testAndPrintLocaleWarning(ErrorMessages& errors) {
auto* decimalPoint = std::localeconv()->decimal_point;
auto* decimalPoint = localeconv()->decimal_point;
if (decimalPoint == nullptr || *decimalPoint != '.') {
std::stringstream ss;
ss << "Warning: Current decimal point of the C locale is set to \""
Expand Down
8 changes: 5 additions & 3 deletions lanelet2_io/src/OsmHandlerWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class ToFileWriter {
};

void testAndPrintLocaleWarning(ErrorMessages& errors) {
auto* decimalPoint = std::localeconv()->decimal_point;
auto* decimalPoint = localeconv()->decimal_point;
if (decimalPoint == nullptr || *decimalPoint != '.') {
std::stringstream ss;
ss << "Warning: Current decimal point of the C locale is set to \""
Expand All @@ -296,7 +296,8 @@ void testAndPrintLocaleWarning(ErrorMessages& errors) {
}
} // namespace

void OsmWriter::write(const std::string& filename, const LaneletMap& laneletMap, ErrorMessages& errors, const io::Configuration& params) const {
void OsmWriter::write(const std::string& filename, const LaneletMap& laneletMap, ErrorMessages& errors,
const io::Configuration& params) const {
testAndPrintLocaleWarning(errors);
auto file = toOsmFile(laneletMap, errors, params);
auto doc = osm::write(*file, params);
Expand All @@ -306,7 +307,8 @@ void OsmWriter::write(const std::string& filename, const LaneletMap& laneletMap,
}
}

std::unique_ptr<osm::File> OsmWriter::toOsmFile(const LaneletMap& laneletMap, ErrorMessages& errors, const io::Configuration& params) const {
std::unique_ptr<osm::File> OsmWriter::toOsmFile(const LaneletMap& laneletMap, ErrorMessages& errors,
const io::Configuration& params) const {
return ToFileWriter::writeMap(laneletMap, projector(), errors, params);
}
} // namespace io_handlers
Expand Down

0 comments on commit 18a338b

Please sign in to comment.