Skip to content

Commit

Permalink
Merge bitcoin#29357: test: Drop x modifier in fsbridge::fopen cal…
Browse files Browse the repository at this point in the history
…l 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
  • Loading branch information
fanquake committed Feb 26, 2024
2 parents 60b6ff5 + d2fe905 commit 4d7d7fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/streams_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
}
{
AutoFile xor_file{raw_file("wbx"), xor_pat};
#ifdef __MINGW64__
// Our usage of mingw-w64 and the msvcrt runtime does not support
// the x modifier for the _wfopen().
const char* mode = "wb";
#else
const char* mode = "wbx";
#endif
AutoFile xor_file{raw_file(mode), xor_pat};
xor_file << test1 << test2;
}
{
Expand Down

0 comments on commit 4d7d7fd

Please sign in to comment.