Skip to content

Commit

Permalink
Support boost1.55
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Dec 2, 2017
1 parent 2f54bf5 commit af6eae7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion xs/src/libslic3r/PlaceholderParser.cpp
Expand Up @@ -622,7 +622,7 @@ namespace client
spirit::double_type double_;
spirit::ascii::string_type string;
spirit::repository::qi::iter_pos_type iter_pos;
auto kw = spirit::repository::qi::distinct(qi::copy(alnum | '_'));
auto kw = spirit::repository::qi::distinct(boost::proto::deep_copy(alnum | '_'));

qi::_val_type _val;
qi::_1_type _1;
Expand Down
9 changes: 6 additions & 3 deletions xs/src/slic3r/GUI/GUI.cpp
Expand Up @@ -98,11 +98,14 @@ std::vector<std::string> scan_serial_ports()
#else
// UNIX and OS X
std::initializer_list<const char*> prefixes { "ttyUSB" , "ttyACM", "tty.", "cu.", "rfcomm" };
for (auto &dir_entry : boost::filesystem::directory_iterator(boost::filesystem::path("/dev"))) {
std::string name = dir_entry.path().filename().string();
boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator dir_entry(boost::filesystem::path("/dev"));
dir_entry != end_iter;
++dir_entry) {
std::string name = dir_entry->path().filename().string();
for (const char *prefix : prefixes) {
if (boost::starts_with(name, prefix)) {
out.emplace_back(dir_entry.path().string());
out.emplace_back(dir_entry->path().string());
break;
}
}
Expand Down
11 changes: 7 additions & 4 deletions xs/src/slic3r/GUI/Preset.cpp
Expand Up @@ -251,14 +251,17 @@ void PresetCollection::load_presets(const std::string &dir_path, const std::stri
m_presets.erase(m_presets.begin()+1, m_presets.end());
t_config_option_keys keys = this->default_preset().config.keys();
std::string errors_cummulative;
for (auto &dir_entry : boost::filesystem::directory_iterator(dir))
if (boost::filesystem::is_regular_file(dir_entry.status()) && boost::algorithm::iends_with(dir_entry.path().filename().string(), ".ini")) {
std::string name = dir_entry.path().filename().string();
boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator dir_entry(dir);
dir_entry != end_iter;
++dir_entry)
if (boost::filesystem::is_regular_file(dir_entry->status()) && boost::algorithm::iends_with(dir_entry->path().filename().string(), ".ini")) {
std::string name = dir_entry->path().filename().string();
// Remove the .ini suffix.
name.erase(name.size() - 4);
try {
Preset preset(m_type, name, false);
preset.file = dir_entry.path().string();
preset.file = dir_entry->path().string();
preset.load(keys);
m_presets.emplace_back(preset);
} catch (const std::runtime_error &err) {
Expand Down

0 comments on commit af6eae7

Please sign in to comment.