Update comments in relation to implicit conversion from std::filesystem::path to std::string
There is actually no bug in MinGW. The different behaviour under Windows is expected, because the implicit conversion there is only to std::wstring.master
parent
4790fa00d8
commit
e4b23fecb0
|
@ -444,9 +444,9 @@ main(int argc, char** argv)
|
||||||
dynareroot = dynareroot.parent_path();
|
dynareroot = dynareroot.parent_path();
|
||||||
|
|
||||||
// Construct basename (i.e. remove file extension if there is one)
|
// Construct basename (i.e. remove file extension if there is one)
|
||||||
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
|
/* Calling string() method on filename.stem(): not necessary on GNU/Linux and macOS because there
|
||||||
(shipped in Debian “Bullseye” 11), that fails to accept implicit
|
is an implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed
|
||||||
conversion to string from filename::path. */
|
on Windows because the implicit conversion is only to wstring (i.e. basic_string<wchar_t>). */
|
||||||
const string basename {filename.stem().string()};
|
const string basename {filename.stem().string()};
|
||||||
|
|
||||||
// Forbid some basenames, since they will cause trouble (see preprocessor#62)
|
// Forbid some basenames, since they will cause trouble (see preprocessor#62)
|
||||||
|
|
|
@ -34,9 +34,9 @@ macroExpandModFile(const filesystem::path& filename, const istream& modfile, boo
|
||||||
stringstream macro_output;
|
stringstream macro_output;
|
||||||
macro::Environment env = macro::Environment();
|
macro::Environment env = macro::Environment();
|
||||||
macro::Driver m;
|
macro::Driver m;
|
||||||
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
|
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is an
|
||||||
(shipped in Debian “Bullseye” 11), that fails to accept implicit
|
implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed on
|
||||||
conversion to string from filename::path. */
|
Windows because the implicit conversion is only to wstring (i.e. basic_string<wchar_t>). */
|
||||||
m.parse(filename.string(), modfile, debug, defines, env, paths, macro_output);
|
m.parse(filename.string(), modfile, debug, defines, env, paths, macro_output);
|
||||||
if (save_macro)
|
if (save_macro)
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,10 +75,10 @@ Include::interpret(ostream& output, Environment& env, vector<filesystem::path>&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Driver m;
|
Driver m;
|
||||||
/* Calling `string()` method on filename and filename.stem() because of
|
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is
|
||||||
bug in GCC/MinGW 10.2 (shipped in Debian “Bullseye” 11), that fails
|
an implicit conversion from from filesystem:path to string (i.e. basic_string<char>), but
|
||||||
to accept implicit conversion to string from filename::path. See
|
needed on Windows because the implicit conversion is only to wstring (i.e.
|
||||||
https://en.cppreference.com/w/cpp/filesystem/path/native. */
|
basic_string<wchar_t>). */
|
||||||
m.parse(filename.string(), incfile, false, {}, env, paths, output);
|
m.parse(filename.string(), incfile, false, {}, env, paths, output);
|
||||||
}
|
}
|
||||||
catch (StackTrace& ex)
|
catch (StackTrace& ex)
|
||||||
|
|
Loading…
Reference in New Issue