diff options
author | fanquake <fanquake@gmail.com> | 2024-02-26 16:04:41 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-02-26 16:15:24 +0000 |
commit | 4d7d7fd123113342f09871b1a383cda1bb53d0ea (patch) | |
tree | a298e905369b129db7a2e4771ad0be7c09e80038 | |
parent | 60b6ff5ac030b65d63deda18517a6a5a02ead3b8 (diff) | |
parent | d2fe90571e98e02617682561ea82acb1e2647827 (diff) |
Merge bitcoin/bitcoin#29357: test: Drop `x` modifier in `fsbridge::fopen` call for MinGW builds
d2fe90571e98e02617682561ea82acb1e2647827 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 https://github.com/bitcoin/bitcoin/issues/29014.
ACKs for top commit:
maflcko:
ACK d2fe90571e98e02617682561ea82acb1e2647827
fanquake:
ACK d2fe90571e98e02617682561ea82acb1e2647827 - the plan here should still be to migrate to the newer windows runtime.
Tree-SHA512: 0269b66531e58c093ecda3a3e355a20ee8274e165d7e010f8f125881b3c8d4cfe801abdca4605d81efd3b2dbe9a81896968971f6f53da7f6c6093b76b47c5bc9
-rw-r--r-- | src/test/streams_tests.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp index 7d1ac5a19a..0903f987f6 100644 --- a/src/test/streams_tests.cpp +++ b/src/test/streams_tests.cpp @@ -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; } { |