Skip to content

Commit 4d7d7fd

Browse files
committed
Merge bitcoin#29357: test: Drop x modifier in fsbridge::fopen call for MinGW builds
d2fe905 test: Drop `x` modifier in `fsbridge::fopen` call for mingw builds (Hennadii Stepanov) Pull request description: The MinGW-w64 toolchain links executables to the old msvcrt C Runtime Library that does not support the `x` modifier for the [`_wfopen()`](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170) function. Fixes bitcoin#29014. ACKs for top commit: maflcko: ACK d2fe905 fanquake: ACK d2fe905 - the plan here should still be to migrate to the newer windows runtime. Tree-SHA512: 0269b66531e58c093ecda3a3e355a20ee8274e165d7e010f8f125881b3c8d4cfe801abdca4605d81efd3b2dbe9a81896968971f6f53da7f6c6093b76b47c5bc9
2 parents 60b6ff5 + d2fe905 commit 4d7d7fd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/streams_tests.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
2929
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
3030
}
3131
{
32-
AutoFile xor_file{raw_file("wbx"), xor_pat};
32+
#ifdef __MINGW64__
33+
// Our usage of mingw-w64 and the msvcrt runtime does not support
34+
// the x modifier for the _wfopen().
35+
const char* mode = "wb";
36+
#else
37+
const char* mode = "wbx";
38+
#endif
39+
AutoFile xor_file{raw_file(mode), xor_pat};
3340
xor_file << test1 << test2;
3441
}
3542
{

0 commit comments

Comments
 (0)