mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-13 03:32:22 +00:00
fix include paths parsing under Windows (#541)
This commit is contained in:
parent
b4c55742a6
commit
4d09d04a42
2 changed files with 20 additions and 4 deletions
|
@ -810,14 +810,22 @@ void usage(const char* progname) {
|
||||||
std::exit(2);
|
std::exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr char include_path_separator =
|
||||||
|
#if _WIN32
|
||||||
|
';'
|
||||||
|
#else
|
||||||
|
':'
|
||||||
|
#endif //
|
||||||
|
;
|
||||||
|
|
||||||
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
|
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
|
||||||
td::Parser parser(include_path_set);
|
td::Parser parser(include_path_set);
|
||||||
while (!parser.empty()) {
|
while (!parser.empty()) {
|
||||||
auto path = parser.read_till_nofail(':');
|
auto path = parser.read_till_nofail(include_path_separator);
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
res.push_back(path.str());
|
res.push_back(path.str());
|
||||||
}
|
}
|
||||||
parser.skip_nofail(':');
|
parser.skip_nofail(include_path_separator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,14 +72,22 @@ void usage(const char* progname) {
|
||||||
std::exit(2);
|
std::exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr char include_path_separator =
|
||||||
|
#if _WIN32
|
||||||
|
';'
|
||||||
|
#else
|
||||||
|
':'
|
||||||
|
#endif //
|
||||||
|
;
|
||||||
|
|
||||||
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
|
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
|
||||||
td::Parser parser(include_path_set);
|
td::Parser parser(include_path_set);
|
||||||
while (!parser.empty()) {
|
while (!parser.empty()) {
|
||||||
auto path = parser.read_till_nofail(':');
|
auto path = parser.read_till_nofail(include_path_separator);
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
res.push_back(path.str());
|
res.push_back(path.str());
|
||||||
}
|
}
|
||||||
parser.skip_nofail(':');
|
parser.skip_nofail(include_path_separator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue