Skip to content

Commit

Permalink
register: Remove <filesystem>
Browse files Browse the repository at this point in the history
Use `string::find_last_of()` instead.
Not sure how this works on windows, but it was already using '/' so at least it's not any worse.
  • Loading branch information
KrystalDelusion committed Jan 21, 2025
1 parent 91e4c66 commit 1f6f4db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/register.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <filesystem>

#ifdef YOSYS_ENABLE_ZLIB
#include <zlib.h>
Expand Down Expand Up @@ -1063,9 +1062,10 @@ struct HelpPass : public Pass {
else if (source_file.find("techlibs/") == 0 || (!has_source && name.find("synth_") == 0))
cmd_help.group = "techlibs";
else if (has_source) {
auto p = std::filesystem::path(source_file);
if (p.has_parent_path()) {
cmd_help.group = string(p.parent_path());
auto last_slash = source_file.find_last_of('/');
if (last_slash != string::npos) {
auto parent_path = source_file.substr(0, last_slash);
cmd_help.group = parent_path;
}
}
// implicit !has_source
Expand Down

0 comments on commit 1f6f4db

Please sign in to comment.