mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
Merge bitcoin/bitcoin#33550: Fix windows libc++ fs::path fstream compile errors
c864a4c194Simplify fs::path by dropping filename() and make_preferred() overloads (Ryan Ofsky)b0113afd44Fix windows libc++ fs::path fstream compile errors (Ryan Ofsky) Pull request description: Drop support for passing `fs::path` directly to `std::ifstream` and `std::ofstream` constructors and `open()` functions, because as reported by hebasto in https://github.com/bitcoin/bitcoin/issues/33545, after https://wg21.link/lwg3430 there is no way this can continue to work in windows builds, and there are already compile errors compiling for windows with newer versions of libc++. Instead, add an `fs::path::std_path()` method that returns `std::filesystem::path` references and use it where needed. ACKs for top commit: hebasto: ACKc864a4c194. l0rinc: Code review ACKc864a4c194maflcko: re-ACKc864a4c194🌥 Tree-SHA512: d22372692ab86244e2b2caf4c5e9c9acbd9ba38df5411606b75e428474eabead152fc7ca1afe0bb0df6b818351211a70487e94b40a17b68db5aa757604a0ddf6
This commit is contained in:
@@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE(script_assets_test)
|
||||
bool exists = fs::exists(path);
|
||||
BOOST_WARN_MESSAGE(exists, "File $DIR_UNIT_TEST_DATA/script_assets_test.json not found, skipping script_assets_test");
|
||||
if (!exists) return;
|
||||
std::ifstream file{path};
|
||||
std::ifstream file{path.std_path()};
|
||||
BOOST_CHECK(file.is_open());
|
||||
file.seekg(0, std::ios::end);
|
||||
size_t length = file.tellg();
|
||||
|
||||
Reference in New Issue
Block a user