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();
|
||||
|
||||
// Construct basename (i.e. remove file extension if there is one)
|
||||
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
|
||||
(shipped in Debian “Bullseye” 11), that fails to accept implicit
|
||||
conversion to string from filename::path. */
|
||||
/* Calling string() method on filename.stem(): not necessary on GNU/Linux and macOS because there
|
||||
is an implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed
|
||||
on Windows because the implicit conversion is only to wstring (i.e. basic_string<wchar_t>). */
|
||||
const string basename {filename.stem().string()};
|
||||
|
||||
// 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;
|
||||
macro::Environment env = macro::Environment();
|
||||
macro::Driver m;
|
||||
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
|
||||
(shipped in Debian “Bullseye” 11), that fails to accept implicit
|
||||
conversion to string from filename::path. */
|
||||
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is an
|
||||
implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed on
|
||||
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);
|
||||
if (save_macro)
|
||||
{
|
||||
|
|
|
@ -75,10 +75,10 @@ Include::interpret(ostream& output, Environment& env, vector<filesystem::path>&
|
|||
}
|
||||
}
|
||||
Driver m;
|
||||
/* Calling `string()` method on filename and filename.stem() because of
|
||||
bug in GCC/MinGW 10.2 (shipped in Debian “Bullseye” 11), that fails
|
||||
to accept implicit conversion to string from filename::path. See
|
||||
https://en.cppreference.com/w/cpp/filesystem/path/native. */
|
||||
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is
|
||||
an implicit conversion from from filesystem:path to string (i.e. basic_string<char>), but
|
||||
needed on Windows because the implicit conversion is only to wstring (i.e.
|
||||
basic_string<wchar_t>). */
|
||||
m.parse(filename.string(), incfile, false, {}, env, paths, output);
|
||||
}
|
||||
catch (StackTrace& ex)
|
||||
|
|
Loading…
Reference in New Issue